Skip to content

Commit 79d2cbb

Browse files
committed
imporved hard-coded assertions in test cases
1 parent 5a8adff commit 79d2cbb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/channels/test_py_channel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from ghoshell_moss.core.concepts.command import CommandTask, PyCommand
55
from ghoshell_moss.core.py_channel import PyChannel
66
from ghoshell_moss.message import Message, new_text_message
7+
from ghoshell_moss.message.contents import Text
78

89
chan = PyChannel(name="test")
910

@@ -219,5 +220,5 @@ def foo() -> list[Message]:
219220
# 更新后, messages 也变更了.
220221
await broker.refresh_meta()
221222
assert len(broker.meta().context) == 2
222-
assert broker.meta().context[0].contents == [{"type": "text", "data": {"text": "hello"}}]
223-
assert broker.meta().context[1].contents == [{"type": "text", "data": {"text": "world"}}]
223+
assert broker.meta().context[0].contents[0] == Text(text="hello").to_content()
224+
assert broker.meta().context[1].contents[0] == Text(text="world").to_content()

0 commit comments

Comments
 (0)