Telethon/tests/telethon/tl/test_serialization.py

14 lines
347 B
Python
Raw Normal View History

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