Refactor message.Answer class in a way, that it can be constructed dynamically step by step, in preparation of using streaming API.

This commit is contained in:
Oleksandr Kozachuk
2023-10-20 13:43:31 +02:00
parent 17c6fa2453
commit 2aee018708
3 changed files with 89 additions and 17 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ class QuestionTestCase(unittest.TestCase):
class AnswerTestCase(unittest.TestCase):
def test_answer_with_header(self) -> None:
with self.assertRaises(MessageError):
Answer(f"{Answer.txt_header}\nno")
str(Answer(f"{Answer.txt_header}\nno"))
def test_answer_with_legal_header(self) -> None:
answer = Answer(f"This is a line contaning '{Answer.txt_header}'\nIt is what it is.")