mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
feat(helpers): implement new descriptor with default value getter (#336)
* feat(helpers): implement new descriptor with default value getter * perf(descriptor): use weakref refuse weak reference to a value in WeakRefDict instead of polluting instance namespace * chore(descriptor): rename descriptor class rename `DefaultProperty` to `Default` * style(fmt): lint code
This commit is contained in:
parent
9f11afda5b
commit
aed3642385
4 changed files with 112 additions and 50 deletions
|
|
@ -49,14 +49,9 @@ class TestBaseSession:
|
|||
return json.dumps
|
||||
|
||||
session.json_dumps = custom_dumps
|
||||
assert session.json_dumps == custom_dumps == session._json_dumps
|
||||
assert session.json_dumps == custom_dumps
|
||||
session.json_loads = custom_loads
|
||||
assert session.json_loads == custom_loads == session._json_loads
|
||||
|
||||
different_session = CustomSession()
|
||||
assert all(
|
||||
not hasattr(different_session, attr) for attr in ("_json_loads", "_json_dumps", "_api")
|
||||
)
|
||||
assert session.json_loads == custom_loads
|
||||
|
||||
def test_timeout(self):
|
||||
session = CustomSession()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue