Significantly clean-up imports

Sure wish I would've automated this.
This commit is contained in:
Lonami Exo
2023-09-02 23:05:28 +02:00
parent f75acee7e8
commit 4b2d252fe1
52 changed files with 447 additions and 231 deletions

View File

@@ -1,4 +1,4 @@
from telethon._impl.crypto.auth_key import AuthKey
from telethon._impl.crypto import AuthKey
def get_auth_key() -> AuthKey:

View File

@@ -1,4 +1,4 @@
from telethon._impl.crypto.auth_key import AuthKey
from telethon._impl.crypto import AuthKey
from telethon._impl.mtproto.authentication import (
CreatedKey,
_do_step1,

View File

@@ -2,10 +2,8 @@ import os
import random
from pytest import mark
from telethon._impl.client.client.client import Client
from telethon._impl.client.client.net import Config
from telethon._impl.session.message_box.defs import Session
from telethon._impl.tl.mtproto import functions, types
from telethon import Client, Config, Session
from telethon import _tl as tl
@mark.api
@@ -27,6 +25,6 @@ async def test_ping_pong() -> None:
assert client.connected
ping_id = random.randrange(-(2**63), 2**63)
pong = await client(functions.ping(ping_id=ping_id))
assert isinstance(pong, types.Pong)
pong = await client(tl.mtproto.functions.ping(ping_id=ping_id))
assert isinstance(pong, tl.mtproto.types.Pong)
assert pong.ping_id == ping_id

View File

@@ -1,13 +1,13 @@
from telethon._impl.crypto import (
AuthKey,
Side,
_do_encrypt_data_v2,
calc_key,
decrypt_data_v2,
decrypt_ige,
encrypt_ige,
generate_key_data_from_nonce,
)
from telethon._impl.crypto.auth_key import AuthKey
from telethon._impl.crypto.crypto import _do_encrypt_data_v2
def get_test_auth_key() -> AuthKey:

View File

@@ -1,4 +1,4 @@
from telethon._impl.crypto.factorize import factorize
from telethon._impl.crypto import factorize
def test_factorization_1() -> None:

View File

@@ -1,8 +1,8 @@
import struct
from pytest import raises
from telethon._impl.crypto.auth_key import AuthKey
from telethon._impl.mtproto.mtp import Encrypted, Plain, RpcError
from telethon._impl.crypto import AuthKey
from telethon._impl.mtproto import Encrypted, Plain, RpcError
from telethon._impl.tl.mtproto.types import RpcError as GeneratedRpcError

View File

@@ -2,8 +2,8 @@ import asyncio
import logging
from pytest import LogCaptureFixture, mark
from telethon._impl.mtproto.transport.full import Full
from telethon._impl.mtsender.sender import connect
from telethon._impl.mtproto import Full
from telethon._impl.mtsender import connect
from telethon._impl.tl import LAYER, abcs, functions, types
TELEGRAM_TEST_DC_2 = "149.154.167.40:443"

View File

@@ -1,4 +1,4 @@
from telethon._impl.session.chat.packed import PackedChat, PackedType
from telethon._impl.session import PackedChat, PackedType
def test_hash_optional() -> None:

View File

@@ -1,8 +1,7 @@
import struct
from pytest import mark
from telethon._impl.tl.core import Reader
from telethon._impl.tl.core.serializable import Serializable
from telethon._impl.tl.core import Reader, Serializable
from telethon._impl.tl.mtproto.types import BadServerSalt
from telethon._impl.tl.types import GeoPoint

View File

@@ -1,7 +1,7 @@
from typing import Tuple
from pytest import raises
from telethon._impl.mtproto.transport.abridged import Abridged
from telethon._impl.mtproto import Abridged
class Output(bytearray):

View File

@@ -1,7 +1,7 @@
from typing import Tuple
from pytest import raises
from telethon._impl.mtproto.transport.full import Full
from telethon._impl.mtproto import Full
class Output(bytearray):

View File

@@ -1,7 +1,7 @@
from typing import Tuple
from pytest import raises
from telethon._impl.mtproto.transport.intermediate import Intermediate
from telethon._impl.mtproto import Intermediate
class Output(bytearray):