from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
def text(p): return (ROOT/p).read_text()
def test_v029_router_and_pages():
    m=text('app/main.py'); assert 'v029_router' in m and "version='0.38.0'" in m
    assert (ROOT/'app/static/commercial/index.html').exists()
    assert (ROOT/'app/static/customer-portal.html').exists()
def test_v029_models_and_security():
    e=text('app/models/entities.py')
    for n in ['CommercialLead','CheckoutSession','SupportTicket','CustomerHealthSnapshot','CustomerPaymentMethod']:
        assert f'class {n}' in e
    svc=text('app/services/commercial_platform.py')
    assert 'hmac.compare_digest' in svc and 'external_payment_method_id' not in svc
def test_v029_no_raw_card_fields():
    e=text('app/models/entities.py').lower()
    assert 'card_number' not in e and 'cvv' not in e
    assert 'last4' in e
def test_v029_native_preserved():
    assert (ROOT/'install_native.sh').exists() and (ROOT/'start_native.py').exists()
