Selaa lähdekoodia

Add a minimal test to cover handling CDIFF_OPTIONS

Matthew Wang 7 vuotta sitten
vanhempi
commit
a723fbe398
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5
    0
      tests/test_cdiff.py

+ 5
- 0
tests/test_cdiff.py Näytä tiedosto

737
                'cd %s; git add foo; git commit foo -m update' % self._ws]
737
                'cd %s; git add foo; git commit foo -m update' % self._ws]
738
         subprocess.call(cmd, stdout=subprocess.PIPE)
738
         subprocess.call(cmd, stdout=subprocess.PIPE)
739
 
739
 
740
+    def test_preset_options(self):
741
+        os.environ['CDIFF_OPTIONS'] = '--help'
742
+        self.assertRaises(SystemExit, cdiff.main)
743
+        os.environ.pop('CDIFF_OPTIONS', None)
744
+
740
     def test_read_diff(self):
745
     def test_read_diff(self):
741
         sys.argv = sys.argv[:1]
746
         sys.argv = sys.argv[:1]
742
         self._change_file('read_diff')
747
         self._change_file('read_diff')