34
33
'YYYY-MM-DD HH:MM:SS +ZZZZ', string)
37
class DiffBase(ExternalBase):
36
class DiffBase(tests.TestCaseWithTransport):
38
37
"""Base class with common setup method"""
40
39
def make_example_branch(self):
356
355
def test_external_diff(self):
357
356
"""Test that we can spawn an external diff process"""
357
self.disable_missing_extensions_warning()
358
358
# We have to use run_bzr_subprocess, because we need to
359
359
# test writing directly to stdout, (there was a bug in
360
360
# subprocess.py that we had to workaround).
361
361
# However, if 'diff' may not be available
362
362
self.make_example_branch()
363
orig_progress = os.environ.get('BZR_PROGRESS_BAR')
365
os.environ['BZR_PROGRESS_BAR'] = 'none'
366
out, err = self.run_bzr_subprocess('diff -r 1 --diff-options -ub',
367
universal_newlines=True,
370
if orig_progress is None:
371
del os.environ['BZR_PROGRESS_BAR']
373
os.environ['BZR_PROGRESS_BAR'] = orig_progress
363
# this will be automatically restored by the base bzr test class
364
os.environ['BZR_PROGRESS_BAR'] = 'none'
365
out, err = self.run_bzr_subprocess('diff -r 1 --diff-options -ub',
366
universal_newlines=True,
375
368
if 'Diff is not installed on this machine' in err:
376
raise TestSkipped("No external 'diff' is available")
369
raise tests.TestSkipped("No external 'diff' is available")
377
370
self.assertEqual('', err)
378
371
# We have to skip the stuff in the middle, because it depends