Skip to content

Commit

Permalink
update provenance functional tests to stop ignoring null-successor (i…
Browse files Browse the repository at this point in the history
….e. latest) products
  • Loading branch information
alexdunnjpl committed Jan 31, 2024
1 parent b90fc9f commit b2a2637
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/pds/registrysweepers/provenance/test_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ def test_correct_provenance_produced(self):
expected_provenance = {
"urn:nasa:pds:bundle::1.0": "urn:nasa:pds:bundle::1.1",
"urn:nasa:pds:bundle::1.1": "urn:nasa:pds:bundle::2.0",
"urn:nasa:pds:bundle::2.0": None,
"urn:nasa:pds:bundle:collection::10.0": "urn:nasa:pds:bundle:collection::10.1",
"urn:nasa:pds:bundle:collection::10.1": "urn:nasa:pds:bundle:collection::20.0",
"urn:nasa:pds:bundle:collection::20.0": None,
"urn:nasa:pds:bundle:collection:product::100.0": "urn:nasa:pds:bundle:collection:product::100.1",
"urn:nasa:pds:bundle:collection:product::100.1": "urn:nasa:pds:bundle:collection:product::200.0",
"urn:nasa:pds:bundle:collection:product::200.0": None,
}

def crude_update_hash(update: Update) -> str:
Expand All @@ -46,9 +49,6 @@ def crude_update_hash(update: Update) -> str:
provenance.link_records_in_chain(record_chain)

updates = provenance.generate_updates(itertools.chain(*record_chains))
# previously, updates were not generated for latest products, so we need to exclude those from comparison for
# consistency
legacy_updates = [u for u in updates if u.content["ops:Provenance/ops:superseded_by"] is not None]
expected_updates = [
Update(
id=k,
Expand All @@ -61,7 +61,7 @@ def crude_update_hash(update: Update) -> str:
]

self.assertSetEqual(
set(crude_update_hash(u) for u in expected_updates), set(crude_update_hash(u) for u in legacy_updates)
set(crude_update_hash(u) for u in expected_updates), set(crude_update_hash(u) for u in updates)
)


Expand Down

0 comments on commit b2a2637

Please sign in to comment.