b9ea6760d5
M24 and M25 were empty because dev-data never generated nota_medica rows, and M25's M-CHAT fields lived on a different table under a different code than what the indicator reads. Adds a shared CIE-10 enum/generator (notas.py) and wires it into TEA's historias/filas/proyecto. CaCu/CaMa are not wired in yet -- their Persistance migration for nota_medica doesn't exist (documented in M23_M24_M25_NOTA_MEDICA.md).
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
"""Pruebas del descriptor de proyecto (H-1)."""
|
|
|
|
from datetime import date
|
|
|
|
from dev_data.__main__ import _parser
|
|
from dev_data.azar import Azar
|
|
from dev_data.proyectos import PROYECTOS
|
|
from dev_data.tea.filas import TABLAS
|
|
from dev_data.tea.proyecto import TEA
|
|
|
|
|
|
def test_tea_declara_las_diez_tablas_en_el_orden_de_siembra():
|
|
assert tuple(TEA.modelos) == TABLAS
|
|
assert len(TEA.modelos) == 10
|
|
|
|
|
|
def test_generar_devuelve_las_claves_y_cada_fila_es_del_modelo_declarado():
|
|
filas = TEA.generar(5, Azar(7, date(2026, 1, 1)))
|
|
|
|
assert tuple(filas) == tuple(TEA.modelos)
|
|
for clave, lista in filas.items():
|
|
assert all(isinstance(fila, TEA.modelos[clave]) for fila in lista)
|
|
|
|
|
|
def test_el_registro_tiene_a_tea_con_su_nombre():
|
|
assert PROYECTOS["tea"] is TEA
|
|
assert TEA.nombre == "tea"
|
|
|
|
|
|
def test_el_comando_lista_tea_como_subcomando():
|
|
sub = next(a for a in _parser()._actions if a.dest == "comando")
|
|
|
|
assert set(sub.choices) == set(PROYECTOS) | {"poblar"}
|
|
assert "tea" in sub.choices
|