(self, scope: Scope)
| 1488 | return context |
| 1489 | |
| 1490 | def matches(self, scope: Scope) -> tuple[Match, Scope]: |
| 1491 | if isinstance(self.original_route, _FrontendRouteGroup): |
| 1492 | return self.original_route.matches_with_prefix(scope, self.frontend_prefix) |
| 1493 | if not isinstance(self.original_route, APIRoute): |
| 1494 | assert self.starlette_route is not None |
| 1495 | return self.starlette_route.matches(scope) |
| 1496 | if scope["type"] != "http": |
| 1497 | return Match.NONE, {} |
| 1498 | route_path = get_route_path(scope) |
| 1499 | match = self.path_regex.match(route_path) |
| 1500 | if not match: |
| 1501 | return Match.NONE, {} |
| 1502 | matched_params = match.groupdict() |
| 1503 | for key, value in matched_params.items(): |
| 1504 | matched_params[key] = self.param_convertors[key].convert(value) |
| 1505 | path_params = dict(scope.get("path_params", {})) |
| 1506 | path_params.update(matched_params) |
| 1507 | child_scope = {"endpoint": self.endpoint, "path_params": path_params} |
| 1508 | methods = self.methods |
| 1509 | if methods and scope["method"] not in methods: |
| 1510 | return Match.PARTIAL, child_scope |
| 1511 | return Match.FULL, child_scope |
| 1512 | |
| 1513 | def url_path_for(self, name: str, /, **path_params: Any) -> Any: |
| 1514 | if not isinstance(self.original_route, APIRoute): |
nothing calls this directly
no test coverage detected