mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-03 15:40:38 +00:00
Fix getting and using participants
This commit is contained in:
14
client/tests/types_test.py
Normal file
14
client/tests/types_test.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from pytest import mark
|
||||
from telethon._impl.client.types import AdminRight
|
||||
from telethon._impl.tl import types
|
||||
|
||||
|
||||
@mark.parametrize("slot", types.ChatAdminRights.__slots__)
|
||||
def test_admin_right_covers_all(slot: str) -> None:
|
||||
kwargs = {slot: False for slot in types.ChatAdminRights.__slots__}
|
||||
kwargs[slot] = True
|
||||
|
||||
rights = types.ChatAdminRights(**kwargs)
|
||||
rights_set = AdminRight._from_raw(rights)
|
||||
assert len(rights_set) == 1
|
||||
assert next(iter(rights_set)).value == slot
|
||||
Reference in New Issue
Block a user