Download tests/test_revision.py from Changetheblock/LicitaBench: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/datasets/Changetheblock/LicitaBench/resolve/main/tests/test_revision.py
- Command line
-
hf download hf://datasets/Changetheblock/LicitaBench/tests/test_revision.py
-
curl -L -o test_revision.py https://huggingface.co/datasets/Changetheblock/LicitaBench/resolve/main/tests/test_revision.py
1.2 kB
| from licitabench import revision | |
| def test_fragmento_criterio_por_puntos(): | |
| texto = ("CRITERIOS DE ADJUDICACIÓN. 1. Oferta económica: hasta 60 puntos, según la fórmula P = 60 x (Om / Oi). " | |
| "2. Memoria técnica: hasta 40 puntos, juicio de valor.") | |
| et = {"criterios": [{"nombre": "Oferta económica", "puntos": 60, "tipo": "automatico", "es_precio": True}, | |
| {"nombre": "Memoria técnica", "puntos": 40, "tipo": "juicio_valor", "es_precio": False}], | |
| "formula_precio": "P = 60 x (Om / Oi)", "umbral_minimo_tecnico": None} | |
| fr = revision.fragmentos_t2(texto, et) | |
| assert fr["seccion"] and fr["seccion"].startswith("CRITERIOS DE ADJUDICACIÓN") | |
| assert "60 puntos" in fr["criterios"][0] and "40 puntos" in fr["criterios"][1] | |
| def test_pantalla_sin_texto(): | |
| reg = {"id_verificacion": "T2-x", "tarea": "T2", "id": "x", "titulo": "t", "documento": {"url": "u"}, | |
| "etiquetas_propuestas": {"criterios": [], "puntos_automaticos": None, "puntos_juicio_valor": None, | |
| "formula_precio": None, "umbral_minimo_tecnico": None}} | |
| s = revision.pantalla(reg, None) | |
| assert "no disponible" in s | |