from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
def test_v035_files():
    for p in ['app/api/v035.py','app/services/lakehouse_v035.py','app/static/lakehouse.html','migrations/035_enterprise_lakehouse.sql']:
        assert (ROOT/p).exists()
def test_v035_controls():
    text=(ROOT/'app/services/lakehouse_v035.py').read_text()
    for item in ['commit_files','evolve_schema','rollback_to_snapshot','run_maintenance','checksum_sha256','manifest']:
        assert item in text
def test_v035_routes():
    text=(ROOT/'app/api/v035.py').read_text()
    for route in ['/catalogs','/tables','/commit','/snapshots','/rollback','/maintenance','/query-plan']:
        assert route in text
def test_v035_rls():
    sql=(ROOT/'migrations/035_enterprise_lakehouse.sql').read_text()
    assert 'ROW LEVEL SECURITY' in sql and 'WITH CHECK' in sql and 'app.current_tenant_id' in sql
