Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
uhbrar committed Jul 10, 2024
1 parent 6df4071 commit 304ed17
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ def test_merge_identical_attributes():
assert ATTRIBUTE_A in node.attributes
assert len(node.attributes) == 1


def test_merge_knowledge_graph_edges():
"""
Test that knowledge graph edges are merged properly
Expand All @@ -470,13 +471,13 @@ def test_merge_knowledge_graph_edges():
{
"resource_id": "kp0",
"resource_role": "aggregator_knowledge_source",
"upstream_resource_ids": ["ks0"]
"upstream_resource_ids": ["ks0"],
},
{
"resource_id": "ara0",
"resource_role": "aggregator_knowledge_source",
"upstream_resource_ids": ["kp0"]
}
"upstream_resource_ids": ["kp0"],
},
],
"attributes": [],
}
Expand All @@ -501,13 +502,13 @@ def test_merge_knowledge_graph_edges():
{
"resource_id": "kp1",
"resource_role": "aggregator_knowledge_source",
"upstream_resource_ids": ["ks0"]
"upstream_resource_ids": ["ks0"],
},
{
"resource_id": "ara0",
"resource_role": "aggregator_knowledge_source",
"upstream_resource_ids": ["kp1"]
}
"upstream_resource_ids": ["kp1"],
},
],
"attributes": [],
}
Expand All @@ -524,9 +525,9 @@ def test_merge_knowledge_graph_edges():
edges = m.knowledge_graph.edges
assert len(edges) == 1
edge = next(iter(edges.values()))

sources = edge.sources
assert len(sources) == 4
for source in sources:
if source.resource_id == "ara0":
assert len(source.upstream_resource_ids) == 2
assert len(source.upstream_resource_ids) == 2

0 comments on commit 304ed17

Please sign in to comment.