Skip to content

Commit

Permalink
✅ 添加Reply的__str__, __repr__测试
Browse files Browse the repository at this point in the history
  • Loading branch information
AzideCupric committed Dec 29, 2023
1 parent 31254e8 commit 488db8f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ def test_message_segment_to_str():
assert str(i_bytesio) == f"[SAA:Image|name='image',image=<BytesIO {len(b'123')}>]"
assert repr(i_bytesio) == "Image(name='image', image=BytesIO(b'123'))"

# FIXME: Reply还不支持
# r = Reply(MessageId(adapter_name=SupportedAdapters.fake))
# assert r.get("data").get("message_id") == MessageId(
# adapter_name=SupportedAdapters.fake
# )
# assert str(r) == "[SAA:Reply|message_id=MessageId(adapter_name='fake')]"
# assert repr(r) == "Reply(message_id=MessageId(adapter_name='fake'))"
r = Reply(MessageId(adapter_name=SupportedAdapters.fake))
assert r.get("data").get("message_id") == MessageId(
adapter_name=SupportedAdapters.fake
)
assert str(r).startswith("[SAA:Reply|message_id=MessageId(adapter_name=")
assert repr(r).startswith("Reply(message_id=MessageId(adapter_name=")

m = Mention("123")
assert m.get("data").get("user_id") == "123"
Expand Down

0 comments on commit 488db8f

Please sign in to comment.