Download tests/test_camas.py from Modulo-6/api: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/tests/test_camas.py
- Command line
-
hf download hf://spaces/Modulo-6/api@31c8dd67e47a516206b4122c4da00a634486a247/tests/test_camas.py
-
curl -L -o test_camas.py https://huggingface.co/spaces/Modulo-6/api/resolve/31c8dd67e47a516206b4122c4da00a634486a247/tests/test_camas.py
819 Bytes
| """ | |
| Tests de integración para el router de camas. | |
| """ | |
| import pytest | |
| from fastapi.testclient import TestClient | |
| def test_get_camas_sin_auth(client: TestClient): | |
| response = client.get("/api/v1/camas") | |
| assert response.status_code == 401 | |
| def test_crear_cama(client: TestClient): | |
| payload = { | |
| "numero": "101", | |
| "piso": 1, | |
| "sector": "SALA_COMUN", | |
| "tipo": "ESTANDAR", | |
| "hospital_id": "HG-001", | |
| "contraindicaciones_incompatibles": [], | |
| } | |
| response = client.post("/api/v1/camas", json=payload) | |
| assert response.status_code == 201 | |
| data = response.json() | |
| assert data["numero"] == "101" | |
| assert data["estado"] == "DISPONIBLE" | |