Telethon/client/tests/packed_chat_test.py
2023-08-31 17:36:08 +02:00

11 lines
321 B
Python

from telethon._impl.session.chat.packed import PackedChat, PackedType
def test_hash_optional() -> None:
for ty in PackedType:
pc = PackedChat(ty, 123, 456789)
assert PackedChat.from_bytes(bytes(pc)) == pc
pc = PackedChat(ty, 987, None)
assert PackedChat.from_bytes(bytes(pc)) == pc