Compare commits

..

2 Commits

Author SHA1 Message Date
c3f001a85c added new module 'chat.py' 2023-08-26 12:08:47 +02:00
1a14c0e4a8 tests: added testcases for Message.from/to_file() and others 2023-08-26 12:08:47 +02:00

View File

@ -600,15 +600,18 @@ class MessageIDTestCase(CmmTestCase):
class MessageHashTestCase(CmmTestCase): class MessageHashTestCase(CmmTestCase):
def setUp(self) -> None: def setUp(self) -> None:
self.message1 = Message(Question('This is a question.'), self.message1 = Message(Question('This is a question.'),
tags={Tag('tag1')},
file_path=pathlib.Path('/tmp/foo/bla')) file_path=pathlib.Path('/tmp/foo/bla'))
self.message2 = Message(Question('This is a new question.'), self.message2 = Message(Question('This is a new question.'),
file_path=pathlib.Path('/tmp/foo/bla')) file_path=pathlib.Path('/tmp/foo/bla'))
self.message3 = Message(Question('This is a question.'), self.message3 = Message(Question('This is a question.'),
Answer('This is an answer.'), Answer('This is an answer.'),
file_path=pathlib.Path('/tmp/foo/bla')) file_path=pathlib.Path('/tmp/foo/bla'))
# message4 is a copy of message1, because 'file_path' # message4 is a copy of message1, because only question and
# is ignored for hashing and comparison # answer are used for hashing and comparison
self.message4 = Message(Question('This is a question.'), self.message4 = Message(Question('This is a question.'),
tags={Tag('tag1'), Tag('tag2')},
ai='Blabla',
file_path=pathlib.Path('foobla')) file_path=pathlib.Path('foobla'))
def test_set_hashing(self) -> None: def test_set_hashing(self) -> None: