18 lines
554 B
Python
18 lines
554 B
Python
from pydantic import BaseModel
|
|
|
|
from app.schemas import detection, segmentation
|
|
|
|
|
|
def test_model_prefixed_api_fields_are_explicitly_supported() -> None:
|
|
schemas = [
|
|
value
|
|
for module in (detection, segmentation)
|
|
for value in vars(module).values()
|
|
if isinstance(value, type)
|
|
and issubclass(value, BaseModel)
|
|
and any(field_name.startswith("model_") for field_name in value.model_fields)
|
|
]
|
|
|
|
assert schemas
|
|
assert all(schema.model_config.get("protected_namespaces") == () for schema in schemas)
|