aiogram/aiogram
Alex Root Junior 74e00a30b1
"Add get_mounted_bot function and improve model comparison in tests"
In this commit, a new function `get_mounted_bot` was added to `context_controller.py` that returns the bot mounted in context. This function was needed to bypass the limitation in pydantic BaseModel's properties, which neither support computed fields nor serialization/validation.

Various tests were also updated to compare models using `model_dump_json()` method rather than comparing the models directly. This change provides more accurate comparisons by considering default values in the models.

Further, the dispatcher was adjusted to enforce update re-mounting if the mounted bot differs from the current update. This allows shortcuts to be used in the bot's current instance and ensures the correct propagation of the context to all the nested objects and attributes of Updates.
2023-07-16 22:46:45 +03:00
..
client "Add get_mounted_bot function and improve model comparison in tests" 2023-07-16 22:46:45 +03:00
dispatcher "Add get_mounted_bot function and improve model comparison in tests" 2023-07-16 22:46:45 +03:00
enums Fixed subtypes and union types generation, new enums added (#1213) 2023-07-11 23:39:54 +03:00
filters Fixed subtypes and union types generation, new enums added (#1213) 2023-07-11 23:39:54 +03:00
fsm #1186 Renamed USER_IN_THREAD to USER_IN_TOPIC 2023-07-01 21:53:34 +03:00
handlers Dev 3.x flat package (#961) 2022-08-14 01:07:52 +03:00
methods Fixed subtypes and union types generation, new enums added (#1213) 2023-07-11 23:39:54 +03:00
types Fixed subtypes and union types generation, new enums added (#1213) 2023-07-11 23:39:54 +03:00
utils Fixed pydantic deprecation warnings 2023-07-04 00:33:57 +03:00
webhook Fixed pydantic deprecation warnings 2023-07-04 00:33:57 +03:00
__init__.py #1191 Added possibility to pass custom headers to URLInputFile object (#1197) 2023-06-25 01:39:26 +03:00
__meta__.py #1191 Added possibility to pass custom headers to URLInputFile object (#1197) 2023-06-25 01:39:26 +03:00
exceptions.py Formatting tools (#1172) 2023-06-10 20:47:45 +03:00
loggers.py Bot API 5.7 and some new features (#834) 2022-02-19 01:45:59 +02:00
py.typed Add py.typed 2020-04-11 22:01:53 +03:00