3
0
Просмотр исходного кода

Added new test for Controller.process_help()

Stefan Schmidt 6 лет назад
Родитель
Сommit
2a71007601
1 измененных файлов с 8 добавлено и 0 удалено
  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'")