Преглед на файлове

Coverage: pass file= to print_function, test Options.help

Cherry-picked 8cee926b31a59edee08842d0705299f6273c053f from
fixoptions.py3k branch

Conflicts:
	supervisor/compat.py
	supervisor/options.py
Nick Pilon преди 11 години
родител
ревизия
04992e3ea4
променени са 1 файла, в които са добавени 13 реда и са изтрити 0 реда
  1. 13 0
      supervisor/tests/test_options.py

+ 13 - 0
supervisor/tests/test_options.py

@@ -162,6 +162,19 @@ class OptionTests(unittest.TestCase):
         self.assertEqual(config, tempf.name)
         tempf.close()
 
+    def test_help(self):
+        options = self._makeOptions()
+        options.exit = dummy_exit()
+        options.stdout = StringIO()
+        options.progname = 'test_help'
+        options.doc = 'A sample docstring for %s'
+        try:
+            options.help('Argument ignored?')
+        except DummyExitException:
+            self.assertEqual(options.stdout.getvalue(), 'A sample docstring for test_help\n')
+        else:
+            self.fail('help() did not try to exit.')
+
 class ClientOptionsTests(unittest.TestCase):
     def _getTargetClass(self):
         from supervisor.options import ClientOptions