示例#1
0
 def test_help_with_exit_code(self, stderr):
     with self.assertRaises(SystemExit) as cm:
         show_help("add-watcher", exit=2)
     exc = cm.exception
     self.assertEqual(2, exc.code)
     doc = add_watcher.__doc__.format(plugin_name="hc")
     stderr.write.assert_called_with(doc.rstrip() + "\n")
 def test_help_with_exit_code(self, stderr):
     with self.assertRaises(SystemExit) as cm:
         show_help("add-watcher", exit=2)
     exc = cm.exception
     self.assertEqual(2, exc.code)
     doc = add_watcher.__doc__.format(plugin_name="hc")
     stderr.write.assert_called_with(doc.rstrip() + "\n")
示例#3
0
 def test_help(self, stderr):
     with self.assertRaises(SystemExit) as cm:
         show_help("add-url")
     exc = cm.exception
     self.assertEqual(0, exc.code)
     doc = add_url.__doc__.format(plugin_name="hc")
     stderr.write.assert_called_with(doc.rstrip() + "\n")
 def test_help(self, stderr):
     with self.assertRaises(SystemExit) as cm:
         show_help("add-url")
     exc = cm.exception
     self.assertEqual(0, exc.code)
     doc = add_url.__doc__.format(plugin_name="hc")
     stderr.write.assert_called_with(doc.rstrip() + "\n")