Add tests when custom path is provided

This commit is contained in:
Goro 2025-06-27 23:30:41 +02:00
commit 852952dd6d
2 changed files with 207 additions and 1 deletions

View file

@ -127,7 +127,10 @@ def make_route(action, component, config, required_scopes, root_path) -> Route:
]:
path = f"/{{{config['param']}}}/{action}"
else:
path = f"/{component}s/{{{config['param']}}}/{action}"
if root_path != "/" and required_scopes is None:
path = f"{root_path}/{component}s/{{{config['param']}}}/{action}"
else:
path = f"/{component}s/{{{config['param']}}}/{action}"
return Route(path, endpoint=endpoint, methods=["POST"])