Pruebas con todos los indicadores de CaCu y CaMa, como en TEA

La base de prueba es la de demostración del kit (todas las definiciones
calculadas en los periodos que publican) y hay una prueba de figura por
indicador. El caso del mes sin reporte pasa a 2024-11: 2025-11 ya tiene.

Pruebas: WebApi 79 passed.

CSO5.5
This commit is contained in:
2026-10-13 17:25:51 +00:00
parent fecb0247d1
commit b89b630c2e
3 changed files with 33 additions and 40 deletions
+13 -1
View File
@@ -89,7 +89,7 @@ def test_figura_con_parametros_mal_formados_da_400(client, query):
(INDICADOR, "fig_no_existe", ""),
(INDICADOR, FIGURA, "?periodos=2030-S1"), # sin reporte
(INDICADOR, FIGURA, "?periodos=2025-S1,2030-S2"),
(INDICADOR, FIGURA, "?periodos=2025-11"), # un mes sin reporte
(INDICADOR, FIGURA, "?periodos=2024-11"), # un mes sin reporte
],
)
def test_figura_desconocida_o_sin_reporte_da_404(client, indicador, figura, query):
@@ -108,3 +108,15 @@ def test_un_keyerror_interno_no_se_vuelve_404(client, monkeypatch):
monkeypatch.setattr(indicadores, "figura_json", falla)
with pytest.raises(KeyError):
_figura(client, query="?periodos=2025-S1")
# --- Todos los indicadores del proyecto ---
@pytest.mark.parametrize("indicador", sorted(DEFINICIONES))
def test_figura_de_cada_indicador(client, indicador):
for figura in figuras_de(DEFINICIONES[indicador]):
response = _figura(client, indicador, figura)
assert response.status_code == 200, (indicador, figura)
assert set(response.get_json()) >= {"data", "layout"}