mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Move router validation to Router.parent_router
This commit is contained in:
parent
390648aae6
commit
9c2a3d1324
2 changed files with 10 additions and 4 deletions
|
|
@ -2,7 +2,6 @@ import datetime
|
|||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from aiogram.api.types import (
|
||||
CallbackQuery,
|
||||
Chat,
|
||||
|
|
@ -71,6 +70,11 @@ class TestRouter:
|
|||
with pytest.raises(ValueError, match=r"router should be instance of Router"):
|
||||
router.include_router("tests.test_dispatcher.test_router:TestRouter")
|
||||
|
||||
def test_set_parent_router_bad_type(self):
|
||||
router = Router()
|
||||
with pytest.raises(ValueError, match=r"router should be instance of Router"):
|
||||
router.parent_router = object()
|
||||
|
||||
def test_observers_config(self):
|
||||
router = Router()
|
||||
assert router.update_handler.handlers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue