diff --git a/unittests/test_sync_node.py b/unittests/test_sync_node.py index beb203062bf80bdd79522eb383ff653a1f955a95..131868dc6cdc760ba939bfed2421db1e130f12d7 100644 --- a/unittests/test_sync_node.py +++ b/unittests/test_sync_node.py @@ -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