From c4fda4e3e32c4ed3626391c22b6d729775d4532b Mon Sep 17 00:00:00 2001 From: sabby Date: Mon, 19 Oct 2020 21:35:30 +0530 Subject: [PATCH] Add tests --- tests/test_dispatcher/test_router.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_dispatcher/test_router.py b/tests/test_dispatcher/test_router.py index 9d425388..a9f1f063 100644 --- a/tests/test_dispatcher/test_router.py +++ b/tests/test_dispatcher/test_router.py @@ -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))