Download tests/test_solicitudes.py from Modulo-6/api: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/tests/test_solicitudes.py
- Command line
-
hf download hf://spaces/Modulo-6/api@31c8dd67e47a516206b4122c4da00a634486a247/tests/test_solicitudes.py
-
curl -L -o test_solicitudes.py https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/tests/test_solicitudes.py
886 Bytes
| """ | |
| Tests de integración para el router de solicitudes. | |
| """ | |
| import pytest | |
| from fastapi.testclient import TestClient | |
| def test_get_solicitudes_sin_auth(client: TestClient): | |
| response = client.get("/api/v1/solicitudes") | |
| assert response.status_code == 401 | |
| def test_recibir_solicitud_webhook(client: TestClient): | |
| from datetime import datetime, timezone | |
| payload = { | |
| "tipo": "INTERNACION", | |
| "solicitud_hce_id": "HCE-001", | |
| "paciente_id": 1, | |
| "medico_solicitante_id": 10, | |
| "timestamp": datetime.now(timezone.utc).isoformat(), | |
| } | |
| response = client.post("/api/v1/webhooks/hce/solicitud", json=payload) | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert data["estado"] == "PENDIENTE" | |