Add test to prove the fix is valid

This commit is contained in:
Mix
2022-02-06 18:55:19 +08:00
parent 28cfa45d95
commit f4395d77d7
2 changed files with 25 additions and 7 deletions

View File

@ -21,9 +21,9 @@ def make_fake_message() -> Type["Message"]:
def text(cls, text: str):
return cls("text", {"text": text})
@classmethod
def image(cls, url: str):
return cls("image", {"url": url})
@staticmethod
def image(url: str):
return FakeMessageSegment("image", {"url": url})
def is_text(self) -> bool:
return self.type == "text"