Fixed tests.

This commit is contained in:
2023-08-05 13:21:17 +02:00
parent 01de75bef3
commit 8bb2a002a6
3 changed files with 17 additions and 7 deletions
+8 -4
View File
@@ -95,7 +95,10 @@ class TestHandleQuestion(unittest.TestCase):
question=[self.question],
source=None,
only_source_code=False,
number=3
number=3,
match_all_tags=False,
with_tags=False,
with_file=False,
)
self.config = {
'db': 'test_files',
@@ -119,7 +122,8 @@ class TestHandleQuestion(unittest.TestCase):
mock_create_chat.assert_called_once_with(self.question,
self.args.tags,
self.args.extags,
self.config)
self.config,
False, False, False)
mock_pp.assert_called_once_with("test_chat")
mock_ai.assert_called_with("test_chat",
self.config,
@@ -203,7 +207,7 @@ class TestCreateParser(unittest.TestCase):
mock_add_mutually_exclusive_group.assert_called_once_with(required=True)
mock_group.add_argument.assert_any_call('-p', '--print', help='File to print')
mock_group.add_argument.assert_any_call('-q', '--question', nargs='*', help='Question to ask')
mock_group.add_argument.assert_any_call('-D', '--chat-dump', help="Print chat as Python structure", action='store_true')
mock_group.add_argument.assert_any_call('-d', '--chat', help="Print chat as readable text", action='store_true')
mock_group.add_argument.assert_any_call('-D', '--chat-dump', help="Print chat history as Python structure", action='store_true')
mock_group.add_argument.assert_any_call('-d', '--chat', help="Print chat history as readable text", action='store_true')
self.assertTrue('.config.yaml' in parser.get_default('config'))
self.assertEqual(parser.get_default('number'), 1)