mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-27 16:24:31 -04:00
* fix #1144 * fix type checks * refactor test routes package * fix #1208 * unify test routes into module
This commit is contained in:
17
tests/utils/routes/_base.py
Normal file
17
tests/utils/routes/_base.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pydantic import UUID4
|
||||
|
||||
|
||||
def v1(route: str) -> str:
|
||||
return f"/api{route}"
|
||||
|
||||
|
||||
class RoutesBase:
|
||||
prefix = "/api"
|
||||
base = f"{prefix}/"
|
||||
|
||||
def __init__(self) -> None:
|
||||
raise NotImplementedError("This class is not meant to be instantiated.")
|
||||
|
||||
@classmethod
|
||||
def item(cls, item_id: int | str | UUID4) -> str:
|
||||
return f"{cls.base}/{item_id}"
|
||||
Reference in New Issue
Block a user