Improve coverage

This commit is contained in:
sabby 2020-10-20 14:31:46 +05:30
parent 02a2022bbc
commit 71215bf0b9
No known key found for this signature in database
GPG key ID: 93558A49FB9E8D2C

View file

@ -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