Telethon/tests/telethon/tl/test_serialization.py

14 lines
327 B
Python
Raw Normal View History

2020-02-28 12:42:23 +03:00
import pytest
2021-09-12 14:27:13 +03:00
from telethon import _tl
2020-02-28 12:42:23 +03:00
def test_nested_invalid_serialization():
large_long = 2**62
request = _tl.fn.account.SetPrivacy(
2021-09-12 14:27:13 +03:00
key=_tl.InputPrivacyKeyChatInvite(),
rules=[_tl.InputPrivacyValueDisallowUsers(users=[large_long])]
2020-02-28 12:42:23 +03:00
)
with pytest.raises(TypeError):
bytes(request)