Commit graph

8 commits

Author SHA1 Message Date
Alex Root Junior
a7b92bb050
PoC: Bot instance inside method shortcuts using pydantic Validation Context (#1210)
* PoC: Mount objects to the Bot instance, bind shortcuts to configured instance

* Fixe docstring of the bind method

* Pass Bot instance explicitly to the URLInputFile

* Added tests

* Added changelog

* Refactor aiogram client and update tests

Refactored base.py to improve code readability by separating response_type operation from model_validate(). Also, adjusted the parameters in URLInputFile() within test_input_file.py for better test coverage. Updated input_file.py to streamline read method and avoid unnecessary instantiation of Bot class. Lastly, adjusted typing in methods/base.py to enhance code clarity.

* Update changelog
2023-07-11 23:17:26 +03:00
Alex Root Junior
fea1b7b0a3
Reworked request builder (#1142)
* Reworked request builder

* Added more default values

* Update tests

* Fixed timestamp

* Fixed Py3.8 support

* Describe changes
2023-03-11 20:46:36 +02:00
Alex Root Junior
655b3a2d48
Remove warnings about pytest asyncio mode 2022-12-30 16:10:06 +02:00
Oleg A
f2f276b8cf
refactor: remove redundant pytest marks (#654) 2021-08-03 23:40:14 +03:00
Alex Root Junior
4008a3114d
Upgrade architecture + 5.0 Bot API (#469)
Upgrade architecture + 5.0 Bot API (#469)
* Moved `methods`, `types` and `client` to root package
* Removed update handler from routers to dispatcher
* Reworked events propagation mechanism to handlers
* Reworked inner middlewares logic (very small change)
* Updated to Bot API 5.0
* Initial migration from MkDocs to Sphinx + config for readthedocs
2021-01-26 21:20:52 +02:00
Alex Root Junior
f5684aef07 Update default parse_mode propagation. 2020-06-14 18:18:29 +03:00
Dima Boger
023245c76b Add sentinel value for parse_mode which can be None itself
Resolves #302. We decided to use sentinel pattern (https://python-patterns.guide/python/sentinel-object/) as a solution, but got a few problems with plain `object()`, so instead we use unittest.mock.sentinel and we hope it won't cause side effects.

Most of work done via tg-codegen (https://github.com/aiogram/tg-codegen/pull/1), so it's good to review only implementation of sentinel, processing sentinel in `prepare_parse_mode`, changes in base method model and little test fixes.
2020-04-12 19:37:01 +03:00
Alex Root Junior
e12aca9046 Move prepare_<field> to single module and add tests for default parse_mode 2019-12-26 01:35:21 +02:00