ai-memory-backend / tests /test_html_fast_path.py
Baida07's picture
sync: 192 file da Baida98/AI@6bb6a205 (2026-08-26 18:57 UTC) [deploy-all] (#83)
32e5f06
Raw
History Blame Contribute Delete
1.27 kB
from agents.html_fast_path import classify_html_fast_path
def test_accepts_self_contained_single_html():
decision = classify_html_fast_path(
"Crea una mini-app lista spesa in un solo file index.html con aggiunta e filtro"
)
assert decision.eligible is True
assert decision.path == "index.html"
assert decision.reason == "self_contained_single_html"
def test_accepts_explicit_html_file_without_network():
decision = classify_html_fast_path(
"Genera una pagina web HTML in un solo file todo.html con CSS e JavaScript inline"
)
assert decision.eligible is True
assert decision.path == "todo.html"
def test_rejects_deploy_and_external_dependencies():
assert not classify_html_fast_path(
"Crea una mini-app HTML in un solo file index.html e pubblicala su GitHub"
).eligible
assert not classify_html_fast_path(
"Crea una pagina HTML single-file che usa fetch https://api.example.com"
).eligible
def test_rejects_multi_file_or_sensitive_tasks():
assert not classify_html_fast_path(
"Crea una app React multi-file con backend API"
).eligible
assert not classify_html_fast_path(
"Crea una pagina HTML in un solo file con login e database"
).eligible