Quellcode durchsuchen

Added new test for Controller.process_help()

Stefan Schmidt vor 6 Jahren
Ursprung
Commit
2a71007601
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 8 0
      code/Test/test_Controller.py

+ 8 - 0
code/Test/test_Controller.py

@@ -58,3 +58,11 @@ class TestController(unittest.TestCase):
     def test_process_help_examples(self, mock_print):
         Ctrl.Controller.process_help(["examples"])
         self.assertTrue(mock_print.called)
+
+    @mock.patch("builtins.print")
+    def test_process_help_invalid(self, mock_print):
+        Ctrl.Controller.process_help(["invalid_keyword"])
+        self.assertTrue(mock_print.called)
+        self.assertEqual(mock_print.call_count, 2)
+        self.assertEqual(mock_print.call_args_list[0][0][0],
+                         "Unknown keyword 'invalid_keyword', try 'help;' to get a list of allowed keywords'")