@unittest.skipIf(not os.path.exists('/usr/bin/diff'),
                   'requires /usr/bin/diff')
  def test_Diff_Exception_ExternalDiff(self):
    os.environ['TEST_DIFF'] = '/usr/bin/diff'
    basetest._WriteTestData(b'01: text A\n02: text B\n03: C', self.data1_file)
    basetest._WriteTestData(b'01: text A\n02: zzzzzz\n03: C', self.data2_file)

    with self.assertRaises(basetest.OutputDifferedError) as error_context:
      basetest._Diff(self.data1_file, self.data2_file)

    # Check that both filenames and the TEST_DIFF command
    # are present in the exception error message.
    diff_error_message = str(error_context.exception)
    self.assertIn('/usr/bin/diff', diff_error_message)
    self.assertIn('provided_1', diff_error_message)
    self.assertIn('provided_2', diff_error_message)
Test that _Diff executes TEST_DIFF when supplied and there are diffs.
dataset/ETHPy150Open google/google-apputils/tests/basetest_test.py/GoogleTestBaseUnitTest.test_Diff_Exception_ExternalDiff