Spaces:
Running
Running
test: cover unified media inspection route
Browse files
tests/test_media_inspect_contract.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from fastapi.testclient import TestClient
|
| 4 |
+
|
| 5 |
+
from main import create_app
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def test_media_inspect_route_uses_standard_input_validation(settings) -> None:
|
| 9 |
+
with TestClient(create_app(settings)) as client:
|
| 10 |
+
response = client.post("/v1/media/inspect", json={})
|
| 11 |
+
|
| 12 |
+
assert response.status_code == 422
|
| 13 |
+
payload = response.json()
|
| 14 |
+
assert payload["success"] is False
|
| 15 |
+
assert payload["error"]["code"] == "INVALID_INPUT"
|
| 16 |
+
assert "No media input found" in payload["error"]["message"]
|