()
| 384 | |
| 385 | |
| 386 | def test_reverse_mount_urls() -> None: |
| 387 | mounted = Router([Mount("/users", ok, name="users")]) |
| 388 | assert mounted.url_path_for("users", path="/a") == "/users/a" |
| 389 | |
| 390 | users = Router([Route("/{username}", ok, name="user")]) |
| 391 | mounted = Router([Mount("/{subpath}/users", users, name="users")]) |
| 392 | assert mounted.url_path_for("users:user", subpath="test", username="tom") == "/test/users/tom" |
| 393 | assert mounted.url_path_for("users", subpath="test", path="/tom") == "/test/users/tom" |
| 394 | |
| 395 | mounted = Router([Mount("/users", ok, name="users")]) |
| 396 | with pytest.raises(NoMatchFound): |
| 397 | mounted.url_path_for("users", path="/a", foo="bar") |
| 398 | |
| 399 | mounted = Router([Mount("/users", ok, name="users")]) |
| 400 | with pytest.raises(NoMatchFound): |
| 401 | mounted.url_path_for("users") |
| 402 | |
| 403 | |
| 404 | def test_mount_at_root(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected