mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Improve coverage
This commit is contained in:
parent
02a2022bbc
commit
71215bf0b9
1 changed files with 16 additions and 0 deletions
|
|
@ -475,3 +475,19 @@ class TestRouter:
|
|||
root_router.include_router(i)
|
||||
|
||||
assert root_router.sub_routers == list(reversed(list_of_routers))
|
||||
|
||||
# test level comparisons
|
||||
assert (Router(level=1) > Router()) is True
|
||||
assert (Router(level=1) < Router(level=2)) is True
|
||||
|
||||
with pytest.raises(ValueError, match="Expected Integer got str"):
|
||||
Router(level="cat")
|
||||
|
||||
with pytest.raises(ValueError, match="Router levels must be positive integer."):
|
||||
Router(level=-1)
|
||||
|
||||
with pytest.raises(TypeError, match="'>' not supported between instances of 'router' and 'type'"):
|
||||
_ = Router(level=1) > object
|
||||
|
||||
with pytest.raises(TypeError, match="'<' not supported between instances of 'router' and 'type'"):
|
||||
_ = Router(level=1) < object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue