Skip to content
Snippets Groups Projects
Commit b7d3781a authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: renamed two helper assertion functions

parent ff9bc023
Branches
No related tags found
2 merge requests!178FIX: #96 Better error output for crawl.py script.,!167Sync Graph
Pipeline #51281 passed with warnings
......@@ -32,13 +32,15 @@ from caoscrawler.sync_node import SyncNode, parent_in_list, property_in_list
from test_crawler import basic_retrieve_by_name_mock_up, mock_get_entity_by
def compare_parents(p1, p2):
def assert_parents_equal(p1, p2):
"""Special assertion for comparing parents."""
for a, b in zip(p1, p2):
assert a.id == b.id
assert a.name == b.name
def compare_properties(p1, p2):
def assert_properties_equal(p1, p2):
"""Special assertion for comparing properties."""
for a, b in zip(p1, p2):
assert a.id == b.id
assert a.name == b.name
......@@ -62,8 +64,8 @@ def test_sync_node():
assert sna.role == rec.role
assert sna.name == rec.name
assert sna.description == rec.description
compare_parents(sna.parents, rec.parents)
compare_properties(sna.properties, rec.properties)
assert_parents_equal(sna.parents, rec.parents)
assert_properties_equal(sna.properties, rec.properties)
# ... special case File (path and file attributes)
fi = db.File(id=101, name='101', path='/a/')
snb = SyncNode(fi)
......@@ -79,8 +81,8 @@ def test_sync_node():
assert export.role == rec.role
assert export.name == rec.name
assert export.description == rec.description
compare_parents(export.parents, rec.parents)
compare_properties(export.properties, rec.properties)
assert_parents_equal(export.parents, rec.parents)
assert_properties_equal(export.properties, rec.properties)
export = snb.export_entity()
assert export.role == fi.role
assert export.name == fi.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment