mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 12:59:46 +00:00
Continue documentation and reducing public API
This commit is contained in:
@@ -2,7 +2,7 @@ import os
|
||||
import random
|
||||
|
||||
from pytest import mark
|
||||
from telethon import Client, Config, Session
|
||||
from telethon import Client
|
||||
from telethon import _tl as tl
|
||||
|
||||
|
||||
@@ -22,3 +22,5 @@ async def test_ping_pong() -> None:
|
||||
pong = await client(tl.mtproto.functions.ping(ping_id=ping_id))
|
||||
assert isinstance(pong, tl.mtproto.types.Pong)
|
||||
assert pong.ping_id == ping_id
|
||||
|
||||
await client.disconnect()
|
||||
|
@@ -4,11 +4,10 @@ import logging
|
||||
from pytest import LogCaptureFixture, mark
|
||||
from telethon._impl.mtproto import Full
|
||||
from telethon._impl.mtsender import connect
|
||||
from telethon._impl.session import DataCenter
|
||||
from telethon._impl.tl import LAYER, abcs, functions, types
|
||||
|
||||
TELEGRAM_TEST_DC_2 = "149.154.167.40:443"
|
||||
|
||||
TELEGRAM_DEFAULT_TEST_DC = TELEGRAM_TEST_DC_2
|
||||
TELEGRAM_TEST_DC = 2, "149.154.167.40:443"
|
||||
|
||||
TEST_TIMEOUT = 10000
|
||||
|
||||
@@ -22,9 +21,7 @@ async def test_invoke_encrypted_method(caplog: LogCaptureFixture) -> None:
|
||||
def timeout() -> float:
|
||||
return deadline - asyncio.get_running_loop().time()
|
||||
|
||||
sender = await asyncio.wait_for(
|
||||
connect(Full(), TELEGRAM_DEFAULT_TEST_DC), timeout()
|
||||
)
|
||||
sender = await asyncio.wait_for(connect(Full(), *TELEGRAM_TEST_DC), timeout())
|
||||
|
||||
rx = sender.enqueue(
|
||||
functions.invoke_with_layer(
|
||||
|
Reference in New Issue
Block a user