Add tests

This commit is contained in:
sabby 2020-10-19 21:35:30 +05:30
parent 2104368ac8
commit c4fda4e3e3
No known key found for this signature in database
GPG key ID: 93558A49FB9E8D2C

View file

@ -466,3 +466,12 @@ class TestRouter:
response = await root_router.update.trigger(update)
assert response == "KABOOM"
@pytest.mark.asyncio
async def test_router_level_hierarchy(self):
root_router = Router()
list_of_routers = [Router(level=3), Router(level=2), Router()]
for i in list_of_routers:
root_router.include_router(i)
assert root_router.sub_routers == list(reversed(list_of_routers))