105
105
bzrlib.commands.run_bzr, args)
106
106
self.assertEquals(result, retcode)
109
108
def check_inventory_shape(self, inv, shape):
111
110
Compare an inventory to a list of expected names.
138
137
if stdin is None:
139
138
stdin = StringIO("")
140
139
if stdout is None:
141
if hasattr(self, "_log_file"):
142
stdout = self._log_file
140
stdout = self._log_file
145
141
if stderr is None:
146
if hasattr(self, "_log_file"):
147
stderr = self._log_file
142
stderr = self._log_file
150
143
real_stdin = sys.stdin
151
144
real_stdout = sys.stdout
152
145
real_stderr = sys.stderr
154
148
sys.stdout = stdout
155
149
sys.stderr = stderr
156
150
sys.stdin = stdin
157
return a_callable(*args, **kwargs)
151
result = a_callable(*args, **kwargs)
159
153
sys.stdout = real_stdout
160
154
sys.stderr = real_stderr
161
155
sys.stdin = real_stdin
164
159
BzrTestBase = TestCase
190
185
self.fail("contents of %s not as expected")
192
187
def _make_test_root(self):
193
192
if TestCaseInTempDir.TEST_ROOT is not None:
197
root = 'test%04d.tmp' % i
201
if e.errno == errno.EEXIST:
206
# successfully created
207
TestCaseInTempDir.TEST_ROOT = os.path.abspath(root)
194
TestCaseInTempDir.TEST_ROOT = os.path.abspath(
195
tempfile.mkdtemp(suffix='.tmp',
196
prefix=self._TEST_NAME + '-',
209
199
# make a fake bzr directory there to prevent any tests propagating
210
200
# up onto the source directory's real branch
211
201
os.mkdir(os.path.join(TestCaseInTempDir.TEST_ROOT, '.bzr'))
301
291
def selftest(verbose=False, pattern=".*"):
302
return testsweet.run_suite(test_suite(), 'testbzr', verbose=verbose, pattern=pattern)
292
return run_suite(test_suite(), 'testbzr', verbose=verbose, pattern=pattern)
305
295
def test_suite():
322
312
'bzrlib.selftest.versioning',
323
313
'bzrlib.selftest.whitebox',
324
314
'bzrlib.selftest.testmerge3',
325
'bzrlib.selftest.testmerge',
326
315
'bzrlib.selftest.testhashcache',
327
316
'bzrlib.selftest.teststatus',
328
317
'bzrlib.selftest.testlog',
329
318
'bzrlib.selftest.blackbox',
330
319
'bzrlib.selftest.testrevisionnamespaces',
331
320
'bzrlib.selftest.testbranch',
332
'bzrlib.selftest.testremotebranch',
333
321
'bzrlib.selftest.testrevision',
334
322
'bzrlib.selftest.test_merge_core',
335
323
'bzrlib.selftest.test_smart_add',
336
324
'bzrlib.selftest.testdiff',
337
'bzrlib.selftest.test_xml',
339
'bzrlib.selftest.teststore',
340
'bzrlib.selftest.testgraph',
343
328
for m in (bzrlib.store, bzrlib.inventory, bzrlib.branch,