from pathlib import Path


def test_repair_script_does_not_pass_uuid_array_param():
    source = Path('scripts/repair_operator_page_consistency_findings.py').read_text()
    assert 'ANY(CAST(:task_ids AS UUID[]))' not in source
    assert 'WHERE id = CAST(:task_id AS UUID)' in source
    assert 'for task_id in task_ids' in source


def test_repair_script_keeps_dry_run_and_metadata_marker():
    source = Path('scripts/repair_operator_page_consistency_findings.py').read_text()
    assert 'if not apply:' in source
    assert 'repair_operator_page_consistency_findings' in source
