Expose for test
This commit is contained in:
parent
a3c0a2701e
commit
89cfbe9abc
1 changed files with 9 additions and 0 deletions
9
main.py
9
main.py
|
|
@ -145,6 +145,7 @@ from api import recipes as recipes_router # type: ignore
|
|||
|
||||
|
||||
from api import meals as meals_router # type: ignore
|
||||
from api.meals import validate_meal as _validate_meal, get_duplicates as _get_duplicates
|
||||
from api import shopping as shopping_router # type: ignore
|
||||
from api import persons as persons_router # type: ignore
|
||||
from api import auth as auth_router # type: ignore
|
||||
|
|
@ -219,6 +220,14 @@ app.include_router(auth_router.router, prefix="/api/v1", tags=["v1"]) # extract
|
|||
async def healthz():
|
||||
return {"status": "ok"}
|
||||
|
||||
# Backward-compatibility: expose helper functions expected by tests in main
|
||||
def get_duplicates(items):
|
||||
return _get_duplicates(items)
|
||||
|
||||
|
||||
def validate_meal(meal, request: Request | None = None):
|
||||
return _validate_meal(meal, request)
|
||||
|
||||
|
||||
if settings.prod:
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
|
|
|||
Loading…
Reference in a new issue