mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-10 02:35:57 +00:00
Make pyright happy
This commit is contained in:
@@ -65,7 +65,7 @@ def test_key_from_nonce() -> None:
|
||||
server_nonce = int.from_bytes(bytes(range(16)))
|
||||
new_nonce = int.from_bytes(bytes(range(32)))
|
||||
|
||||
(key, iv) = generate_key_data_from_nonce(server_nonce, new_nonce)
|
||||
key, iv = generate_key_data_from_nonce(server_nonce, new_nonce)
|
||||
assert (
|
||||
key
|
||||
== b'\x07X\xf1S;a]$\xf6\xe8\xa9Jo\xcb\xee\nU\xea\xab"\x17\xd7)\\\xa9!=\x1a-}\x16\xa6'
|
||||
|
||||
@@ -7,7 +7,7 @@ from telethon._impl.mtproto import Abridged
|
||||
class Output(bytearray):
|
||||
__slots__ = ()
|
||||
|
||||
def __call__(self, data: bytes) -> None:
|
||||
def __call__(self, data: bytes | bytearray | memoryview) -> None:
|
||||
self += data
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from telethon._impl.mtproto import Full
|
||||
class Output(bytearray):
|
||||
__slots__ = ()
|
||||
|
||||
def __call__(self, data: bytes) -> None:
|
||||
def __call__(self, data: bytes | bytearray | memoryview) -> None:
|
||||
self += data
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ def setup_unpack(n: int) -> Tuple[bytes, Full, bytes, bytearray]:
|
||||
transport, expected_output, input = setup_pack(n)
|
||||
transport.pack(expected_output, input)
|
||||
|
||||
return expected_output, Full(), input, bytearray()
|
||||
return expected_output, Full(), bytes(input), bytearray()
|
||||
|
||||
|
||||
def test_pack_empty() -> None:
|
||||
|
||||
@@ -7,7 +7,7 @@ from telethon._impl.mtproto import Intermediate
|
||||
class Output(bytearray):
|
||||
__slots__ = ()
|
||||
|
||||
def __call__(self, data: bytes) -> None:
|
||||
def __call__(self, data: bytes | bytearray | memoryview) -> None:
|
||||
self += data
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user