Raise if the format is not in the allowed list.
(doc: dict)
| 30 | |
| 31 | |
| 32 | def check_format(doc: dict) -> None: |
| 33 | """Raise if the format is not in the allowed list.""" |
| 34 | fmt = doc.get("format", "") |
| 35 | if fmt not in ALLOWED_FORMATS: |
| 36 | raise ValidationError(f"Unknown format: {fmt}. Allowed: {ALLOWED_FORMATS}") |
| 37 | |
| 38 | |
| 39 | def normalize_fields(doc: dict) -> dict: |
no test coverage detected