from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
def test_v038_files():
    for p in ['app/api/v038.py','app/services/lowcode_bpmn_v038.py','app/static/lowcode-studio.html','migrations/038_bpmn_lowcode_studio.sql']:
        assert (ROOT/p).exists()
def test_v038_features():
    text=(ROOT/'app/services/lowcode_bpmn_v038.py').read_text()
    for x in ['validate_process','validate_form_schema','evaluate_conditions','parallel_split','user_task','subprocess']:
        assert x in text
def test_v038_routes():
    text=(ROOT/'app/api/v038.py').read_text()
    for x in ['/applications','/forms','/processes','/versions','/publish','/start','/instances','/tasks','/rules']:
        assert x in text
def test_v038_rls():
    text=(ROOT/'migrations/038_bpmn_lowcode_studio.sql').read_text()
    assert 'ENABLE ROW LEVEL SECURITY' in text and 'WITH CHECK' in text
def test_v038_native_and_version():
    main=(ROOT/'app/main.py').read_text()
    assert "version='0.38.0'" in main and '/lowcode-studio' in main
