Commit graph

2006 commits

Author SHA1 Message Date
JRoot Junior
bd45d5fcae
Update Giveaway type generation config 2023-12-31 00:08:38 +02:00
Suren Khorenyan
bfaf201fc8 upgrade tests for message content_types and sent_copy 2023-12-31 01:03:11 +03:00
Suren Khorenyan
ff28f19953 Update Message.content_type property 2023-12-31 01:01:54 +03:00
Suren Khorenyan
17daa1e733 update Giveaway objects Unix time field to DateTime type 2023-12-31 00:58:00 +03:00
Suren Khorenyan
896b452495 sort imports in tests (run make reformat lint) 2023-12-31 00:41:14 +03:00
Suren Khorenyan
7ec6e57993 check that all messages and content types are covered for Message.content_type 2023-12-31 00:19:50 +03:00
Suren Khorenyan
422770c2af add tests coverage for Message.react 2023-12-30 23:57:25 +03:00
Suren Khorenyan
b7c1bfe81f fix markdown test apply single entity 2023-12-30 23:10:39 +03:00
Suren Khorenyan
1f997efc62 add tests for Markdown tools 2023-12-30 23:06:00 +03:00
Suren Khorenyan
b3bb5f55fc micro fix Markdown V2 blockquote 2023-12-30 23:05:36 +03:00
Suren Khorenyan
ea8de685d8 fix tests: update ReactionTypeCustomEmoji custom_emoji -> custom_emoji_id 2023-12-30 22:51:34 +03:00
Suren Khorenyan
6feeb61e51 Bot API 7.0 tests for dispatcher handle update removed_chat_boost 2023-12-30 22:50:16 +03:00
Suren Khorenyan
78741e304e Bot API 7.0 tests for dispatcher handle update chat_boost 2023-12-30 22:50:16 +03:00
Suren Khorenyan
4451c4d344 Bot API 7.0 tests for dispatcher handle update message_reaction_count 2023-12-30 22:50:16 +03:00
Suren Khorenyan
d20852f59a Bot API 7.0 tests for dispatcher handle update message_reaction 2023-12-30 22:50:16 +03:00
JRoot Junior
401f34096c
Added changes description 2023-12-30 21:45:13 +02:00
JRoot Junior
66e69e3c93
Test parsing CallbackQuery message (inaccessible and accessible) 2023-12-30 21:39:38 +02:00
JRoot Junior
81f533b3a2
Fixed tests 2023-12-30 21:30:10 +02:00
JRoot Junior
c658514817
Merge remote-tracking branch 'origin/feature/bot-api-7.0' into feature/bot-api-7.0 2023-12-30 21:28:16 +02:00
JRoot Junior
c633738516
Fixed custom_emoji attribute name 2023-12-30 21:28:08 +02:00
Suren Khorenyan
0f949a0ebc Bot API 7.0 tests for SetMessageReaction 2023-12-30 22:02:48 +03:00
Suren Khorenyan
097005355a Bot API 7.0 tests for GetUserChatBoosts 2023-12-30 21:54:53 +03:00
Suren Khorenyan
f75f3b47a5 Bot API 7.0 tests for DeleteMessages 2023-12-30 21:32:40 +03:00
Suren Khorenyan
e697de4df4 Bot API 7.0 tests for CopyMessages 2023-12-30 21:28:47 +03:00
Suren Khorenyan
e536d90db2 Bot API 7.0 tests for ForwardMessages 2023-12-30 21:16:48 +03:00
JRoot Junior
76bddb0824
Fixed text decorations 2023-12-30 19:22:06 +02:00
JRoot Junior
2051457770
Fixed available tests 2023-12-30 12:45:55 +02:00
JRoot Junior
b90eaba684
Added support for Bot API 7.0 2023-12-30 04:40:18 +02:00
SM CheeseNick
756cfeba0a
Update dispatcher.py (#1384)
On line 576 corrected typo in world more (was mre)
2023-12-23 01:47:38 +02:00
JRoot Junior
a2e5f9a8b8
Update changelog 2023-11-24 23:29:21 +02:00
JRoot Junior
69a07e3b0c
Update docs 2023-11-24 21:55:58 +02:00
JRoot Junior
fc9e2b82c6
Added page for deep linking util 2023-11-24 21:27:03 +02:00
JRoot Junior
94939660c7
Update texts 2023-11-24 21:26:33 +02:00
Alex Root Junior
c8dff11d1e
Update thumbnail type to InputFile only (#1374)
* Update thumbnail type to InputFile only

The thumbnail's type restriction has been changed in several methods and types. Previously, it accepted Union[InputFile, str], allowing both InputFile instances and strings. Now it's changed to accept only InputFile instances. This change enhances meaning of the thumbnail fields in due to Bot API accepts only InputFile instances.

* Added changelog

* Fixed typehints
2023-11-24 21:10:02 +02:00
JRoot Junior
09af2a1c8b
Fixed lines range 2023-11-23 02:27:03 +02:00
JRoot Junior
ead79a1927
Fixed typo 2023-11-23 01:56:26 +02:00
JRoot Junior
423796a445
Added translation for Scenes 2023-11-23 01:28:11 +02:00
Alex Root Junior
3d63bf3b99
PoC Scenes (#1280)
* Base implementation

* Small refactoring + added possibility to specify post-action on handlers

* Move scene properties to config object

* Revise aiogram/scenes with wizard-based design pattern

Modified files in aiogram/scenes to incorporate the Wizard design pattern. Files affected are _marker.py, _registry.py, _wizard.py and __init__.py. The changes introduced a SceneWizard Class and ScenesManager, both of which aid in controlling navigation between different scenes or states. This helps clarifying the codebase, streamline scene transitions and offer more control over the app flow.

* Added example

* Small optimizations

* Replace ValueError with SceneException in scenes. Added error safety in scene resolver.

* str

* Added possibility to reset context on scene entered and to handle callback query in any state

* Remove inline markup in example

* Small changes

* Docs + example

* Small refactoring

* Remove scene inclusion methods from router

The methods for including scenes as sub-routers have been removed from the router.py file. Instead, the SceneRegistry class is now set to register scenes by default upon initializing. This streamlines the scene management process by removing redundant routers and making registration automatic.

* Init tests

* Small fix in tests

* Add support for State instance in the scene

The aiogram FSM scene now allows the use of State instance as an argument, enabling more customization. Modified the 'as_handler' method to receive **kwargs arguments, allowing passing of attributes to the handler. An additional type check has been also added to ensure the 'scene' is either a subclass of Scene or a string.

* Fixed test

* Expand test coverage for test_fsm module

The commit enhances tests for the test_fsm module to improve code reliability. It includes additional unit tests for the ObserverDecorator and ActionContainer classes and introduces new tests for the SceneHandlerWrapper class. This ensures the correct functionality of the decorator methods, the action container execution, and the handler wrapper.

* Reformat code

* Fixed long line in the example

* Skip some tests on PyPy

* Change mock return_value

* Compatibility...

* Compatibility...

* Compatibility...

* Added base changes description

* Scenes Tests (#1369)

* ADD tests for `SceneRegistry`

* ADD tests for `ScenesManager`

* ADD Changelog

* Revert "ADD Changelog"

This reverts commit 6dd9301252.

* Remove `@pytest.mark.asyncio`, Reformat code

* Scenes Tests. Part 2 (#1371)

* ADD tests for `SceneWizard`

* ADD tests for `Scene`

* Refactor ObserverDecorator to use on.message syntax in test_scene.py
Cover `Scene::__init_subclass__::if isinstance(value, ObserverDecorator):`

* Refactor `HistoryManager` in `aiogram/fsm/scene.py`
Removed condition that checked if 'history' is empty before calling 'update_data' in 'Scene'.

* ADD tests for `HistoryManager`

* Small changes in the documentation

* Small changes in the documentation

* Small changes in the documentation

---------

Co-authored-by: Andrew <11490628+andrew000@users.noreply.github.com>
2023-11-23 00:41:21 +02:00
JRoot Junior
ce4e1a706d
#1370 added possibility to check X | None on Python >= 3.10 2023-11-20 22:49:55 +02:00
Oleg A
e17e3bc71c
Fix CallbackData without default Optional (#1370)
* fix: CallbackData set optional as None

* docs: add fix changelog

* Add support for nullable fields in callback data

This update extends the callback data handling by adding support for nullable fields. The code now uses the Python typing structures `Optional` and `Union` to parse such fields correctly. A helper function `_check_field_is_nullable` has been added to assist in efficiently checking if a given field is nullable.

* Add support for nullable fields in callback data

This update extends the callback data handling by adding support for nullable fields. The code now uses the Python typing structures `Optional` and `Union` to parse such fields correctly. A helper function `_check_field_is_nullable` has been added to assist in efficiently checking if a given field is nullable.

---------

Co-authored-by: JRoot Junior <jroot.junior@gmail.com>
2023-11-20 22:39:09 +02:00
JRoot Junior
ebade3d51f
Merge test+pypy tests but with separated jobs 2023-11-18 21:45:22 +02:00
JRoot Junior
7b0a6d2050
Separate PyPy tests and disable Windows PyPy tests 2023-11-18 21:43:16 +02:00
JRoot Junior
82f9365180
Try to disable PyPy tests on Windows 2023-11-18 21:35:30 +02:00
JRoot Junior
dd1e8085bf
Fixed Py3.12 tests 2023-11-18 21:28:34 +02:00
Nachtalb
c1bafea3e8
Upgrade to py12 (#1354)
* Upgrade to py12 compatible aiohttp beta version

* Fix uvloop deprecation warning causing pytest not to run

* Fix test due to asyncio task scheduling race condition

* Fix test_state_in_unknown_class for Python 3.12+ due to PEP 678 changes

* Add Python 3.12 support in GitHub Actions and project configurations

* Add changelog entry

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2023-11-18 21:24:19 +02:00
JRoot Junior
c208bcf748
Reformat code 2023-11-17 00:28:47 +02:00
JRoot Junior
0fc718deeb
Small changes in the pending changelog 2023-11-17 00:27:30 +02:00
JRoot Junior
5b59ca679a
Ignore PytestUnraisableExceptionWarning again 2023-11-16 12:40:52 +02:00
JRoot Junior
7e45f482d4
Enable filterwarnings 2023-11-16 12:37:15 +02:00
JRoot Junior
9bced29923
Update translation files 2023-11-16 02:34:57 +02:00