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