from tools.pipeline.provenance import Provenance


def test_provenance_to_dict_roundtrip():
    p = Provenance(
        scale="abyss",
        license="public-domain (US Gov, 17 U.S.C. §105)",
        source="NOAA Ocean Exploration",
        url="https://oceanexplorer.noaa.gov/",
        fetched_at="2026-06-24",
    )
    d = p.to_dict()
    assert d == {
        "scale": "abyss",
        "license": "public-domain (US Gov, 17 U.S.C. §105)",
        "source": "NOAA Ocean Exploration",
        "url": "https://oceanexplorer.noaa.gov/",
        "fetched_at": "2026-06-24",
    }
    assert Provenance.from_dict(d) == p
