Skip to content

Commit

Permalink
Fix test to use check_rels() correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Chantavy committed Jan 4, 2023
1 parent 3c07a8e commit ca92f96
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/integration/cartography/graph/test_cleanupbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_cleanup_interesting_asset_end_to_end(neo4j_session):
'WorldAsset',
'id',
'CONNECTED',
rel_direction_left=True,
rel_direction_right=False,
) == {('interesting-node-id', 'the-worldasset-id-1')}

assert check_rels(
Expand All @@ -46,7 +46,7 @@ def test_cleanup_interesting_asset_end_to_end(neo4j_session):
'HelloAsset',
'id',
'ASSOCIATED_WITH',
rel_direction_left=False,
rel_direction_right=True,
) == {('interesting-node-id', 'the-helloasset-id-1')}

assert check_rels(
Expand All @@ -56,7 +56,7 @@ def test_cleanup_interesting_asset_end_to_end(neo4j_session):
'SubResource',
'id',
'RELATIONSHIP_LABEL',
rel_direction_left=True,
rel_direction_right=False,
) == {('interesting-node-id', 'sub-resource-id')}

# Arrange: Suppose only InterestingAsset and its SubResource connection exist now at timestamp lastupdated=2.
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_cleanup_interesting_asset_end_to_end(neo4j_session):
'WorldAsset',
'id',
'CONNECTED',
rel_direction_left=True,
rel_direction_right=True,
) == set()
# but we don't delete the WorldAsset itself, as that cleanup should be handled by the WorldAsset's own intel module:
assert check_nodes(neo4j_session, 'WorldAsset', ['id']) == {('the-worldasset-id-1',)}
Expand All @@ -97,7 +97,7 @@ def test_cleanup_interesting_asset_end_to_end(neo4j_session):
'HelloAsset',
'id',
'ASSOCIATED_WITH',
rel_direction_left=False,
rel_direction_right=False,
) == set()
# but we don't delete the HelloAsset itself, as that cleanup should be handled by the HelloAsset's own intel module:
assert check_nodes(neo4j_session, 'HelloAsset', ['id']) == {('the-helloasset-id-1',)}
Expand All @@ -110,7 +110,7 @@ def test_cleanup_interesting_asset_end_to_end(neo4j_session):
'SubResource',
'id',
'RELATIONSHIP_LABEL',
rel_direction_left=True,
rel_direction_right=False,
) == {('interesting-node-id', 'sub-resource-id')}
# And we expect to be able to retrieve fields from the InterestingAsset,
assert check_nodes(neo4j_session, 'InterestingAsset', ['id', 'property1', 'property2', 'lastupdated']) == {
Expand Down

0 comments on commit ca92f96

Please sign in to comment.