cmm: the 'hist' command now uses the new 'ChatDB'

This commit is contained in:
2023-09-02 08:21:49 +02:00
parent eb0d97ddc8
commit b0504aedbe
2 changed files with 42 additions and 33 deletions
+9 -6
View File
@@ -115,11 +115,12 @@ class TestHandleQuestion(CmmTestCase):
self.question = "test question"
self.args = argparse.Namespace(
tags=['tag1'],
extags=['extag1'],
atags=None,
etags=['etag1'],
output_tags=None,
question=[self.question],
source=None,
only_source_code=False,
source_code_only=False,
number=3,
max_tokens=None,
temperature=None,
@@ -143,16 +144,18 @@ class TestHandleQuestion(CmmTestCase):
with patch("chatmastermind.storage.open", open_mock):
ask_cmd(self.args, self.config)
mock_print_tag_args.assert_called_once_with(self.args.tags,
self.args.extags,
self.args.etags,
[])
mock_create_chat_hist.assert_called_once_with(self.question,
self.args.tags,
self.args.extags,
self.args.etags,
self.config,
False, False, False)
match_all_tags=False,
with_tags=False,
with_file=False)
mock_print_chat_hist.assert_called_once_with('test_chat',
False,
self.args.only_source_code)
self.args.source_code_only)
mock_ai.assert_called_with("test_chat",
self.config,
self.args.number)