BuyingAgent/backend/tests/unit/test_project_criteria_parse.py
Lars b276758ee1
All checks were successful
Deploy Development / deploy (push) Successful in 1m19s
Test Suite / pytest-backend (push) Successful in 31s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-checks (push) Successful in 28s
Stelle den Frontend-MVP und die v0.3-API auf develop bereit, damit Dev API und PWA zusammen deployen.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-04 13:04:59 +02:00

28 lines
899 B
Python

from uuid import uuid4
from app.discovery.criteria import parse_project_criteria
from app.settings import Settings
def test_parse_accepts_definition_id_and_enabled_flag():
definition_id = uuid4()
parsed = parse_project_criteria(
{
"items": [
{
"criterion_definition_id": str(definition_id),
"operator": ">=",
"value": 24,
"enabled_for_discovery": True,
}
]
}
)
assert parsed["items"][0]["criterion_definition_id"] == definition_id
assert parsed["items"][0]["enabled_for_discovery"] is True
def test_cors_origins_are_split_from_environment():
settings = Settings(cors_allowed_origins="http://localhost:4173, http://127.0.0.1:4173")
assert settings.cors_origins == ["http://localhost:4173", "http://127.0.0.1:4173"]