This commit is contained in:
2026-02-07 01:24:37 +03:00
parent a21570e779
commit c07ee92371
12 changed files with 512 additions and 20 deletions
+11
View File
@@ -248,6 +248,17 @@ def test_finds_appropriate_handler_executes_handler_with_flags_by_alias(capsys:
assert "Hello World!" in output.out
def test_finds_appropriate_handler_raises_runtime_error_when_handler_not_found() -> None:
router = Router()
@router.command('hello')
def handler(_res: Response) -> None:
pass
with pytest.raises(RuntimeError, match="Handler for 'unknown' command not found. Panic!"):
router.finds_appropriate_handler(InputCommand('unknown'))
# ============================================================================
# Tests for alias and trigger collision detection
# ============================================================================