Skip to content

Commit

Permalink
expand AncestryMemoryOptimizedTestCase
Browse files Browse the repository at this point in the history
now covers case where a collection with no shared member refs exists
  • Loading branch information
alexdunnjpl committed Dec 20, 2023
1 parent 91a10d6 commit 8f5e560
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions tests/pds/registrysweepers/test_ancestry.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ def test_ancestor_reference_aggregation(self):
collection1_1 = PdsLidVid.from_string("a:b:c:bundle:first_collection::1.0")
collection1_2 = PdsLidVid.from_string("a:b:c:bundle:first_collection::2.0")
collection2_1 = PdsLidVid.from_string("a:b:c:bundle:second_collection::1.0")
collections = {collection1_1, collection1_2, collection2_1}
overlapping_collections = {collection1_1, collection2_1}
nonoverlapping_collections = {collection1_2}
collections = overlapping_collections.union(nonoverlapping_collections)

product1_1 = PdsLidVid.from_string("a:b:c:bundle:first_collection:first_unique_product::1.0")
product1_2 = PdsLidVid.from_string("a:b:c:bundle:first_collection:first_unique_product::2.0")
Expand Down Expand Up @@ -344,7 +346,7 @@ def test_ancestor_reference_aggregation(self):
lidvid=product2_1, parent_bundle_lidvids={bundle}, parent_collection_lidvids={collection2_1}
),
AncestryRecord(
lidvid=product_common, parent_bundle_lidvids={bundle}, parent_collection_lidvids=collections
lidvid=product_common, parent_bundle_lidvids={bundle}, parent_collection_lidvids=overlapping_collections
),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"This tests the new memory-optimized implementation of ancestry.generation.get_nonaggregate_ancestry_records() to",
"ensure that it is accumulating correctly.",
"",
"Currently, does not incorporate a collection which shares no common elements with any other collections (use 1_2 for this in future)",
"",
"The overlapping-collection query which underpins the new implementation must be tested manually, separately."
],
"get_nonaggregate_ancestry_records": [
Expand All @@ -23,8 +21,7 @@
"_source": {
"collection_lidvid": "a:b:c:bundle:first_collection::2.0",
"product_lidvid": [
"a:b:c:bundle:first_collection:first_unique_product::2.0",
"a:b:c:bundle:first_collection:overlapping_product::1.0"
"a:b:c:bundle:first_collection:first_unique_product::2.0"
]
}
},
Expand Down Expand Up @@ -52,8 +49,7 @@
"_source": {
"collection_lidvid": "a:b:c:bundle:first_collection::2.0",
"product_lidvid": [
"a:b:c:bundle:first_collection:first_unique_product::2.0",
"a:b:c:bundle:first_collection:overlapping_product::1.0"
"a:b:c:bundle:first_collection:first_unique_product::2.0"
]
}
},
Expand Down

0 comments on commit 8f5e560

Please sign in to comment.