question_cmd: now also accepts Messages as source files
This commit is contained in:
parent
8e5da48f4d
commit
be8747c8ad
@ -181,14 +181,15 @@ This is embedded source code.
|
|||||||
|
|
||||||
def test_single_question_with_message_and_embedded_code(self) -> None:
|
def test_single_question_with_message_and_embedded_code(self) -> None:
|
||||||
self.args.ask = ["What is this?"]
|
self.args.ask = ["What is this?"]
|
||||||
self.args.source_text = [f"{self.chat.messages[1].file_path}"]
|
self.args.source_code = [f"{self.chat.messages[1].file_path}"]
|
||||||
message = create_message(self.chat, self.args)
|
message = create_message(self.chat, self.args)
|
||||||
self.assertIsInstance(message, Message)
|
self.assertIsInstance(message, Message)
|
||||||
# file contains no source code (only text)
|
# answer contains 1 source code block
|
||||||
# -> don't expect any in the question
|
# -> expect it in the question
|
||||||
self.assertEqual(len(message.question.source_code()), 1)
|
self.assertEqual(len(message.question.source_code()), 1)
|
||||||
self.assertEqual(message.question, Question("""What is this?
|
self.assertEqual(message.question, Question("""What is this?
|
||||||
|
|
||||||
```
|
```
|
||||||
It is embedded code
|
It is embedded code
|
||||||
```"""))
|
```
|
||||||
|
"""))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user