from pathlib import Path import sys import pytest SCRIPTS = Path(__file__).resolve().parents[1] / "scripts" sys.path.insert(0, str(SCRIPTS)) from basin_model import EvidenceState, FacilityRecord, ObservationRecord # noqa: E402 def test_facility_record_rejects_unsupported_polluter_label(): with pytest.raises(ValueError, match="polluter"): FacilityRecord( facility_id="epa:123", name="Example Facility", country="US", source_url="https://example.gov/facility/123", evidence_state=EvidenceState.PERMITTED, public_label="polluter", ) def test_observation_requires_source_provenance(): with pytest.raises(ValueError, match="source_url"): ObservationRecord( observation_id="wqp:1", station_id="usgs:05054000", parameter="total_phosphorus", value=0.1, unit="mg/L", observed_at="2026-08-01T00:00:00Z", source_organization="USGS", source_url="", )