File size: 1,265 Bytes
32e5f06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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