mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Rework session DI and files path wrapper
This commit is contained in:
parent
1357a7a91b
commit
2620a6547c
9 changed files with 98 additions and 40 deletions
|
|
@ -74,25 +74,6 @@ class TestBaseSession:
|
|||
session.json_loads = custom_loads
|
||||
assert session.json_loads == custom_loads
|
||||
|
||||
def test_timeout(self):
|
||||
session = CustomSession()
|
||||
assert session.timeout == session.default_timeout == CustomSession.default_timeout
|
||||
|
||||
session.default_timeout = float(65.0_0) # mypy will complain
|
||||
assert session.timeout != session.default_timeout
|
||||
|
||||
CustomSession.default_timeout = float(68.0_0)
|
||||
assert session.timeout == CustomSession.default_timeout
|
||||
|
||||
session.timeout = float(71.0_0)
|
||||
assert session.timeout != session.default_timeout
|
||||
del session.timeout
|
||||
CustomSession.default_timeout = session.default_timeout + 100
|
||||
assert (
|
||||
session.timeout != BaseSession.default_timeout
|
||||
and session.timeout == CustomSession.default_timeout
|
||||
)
|
||||
|
||||
def test_init_custom_api(self):
|
||||
api = TelegramAPIServer(
|
||||
base="http://example.com/{token}/{method}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue