diff --git a/unittests/test_tool.py b/unittests/test_tool.py index 33ccc230a29697c238ac988bca00ec1e940e88b9..50dcb4b29c99e7ed0b4e79e0c9322e5e774c13a4 100755 --- a/unittests/test_tool.py +++ b/unittests/test_tool.py @@ -287,7 +287,6 @@ def test_crawler_update_list(crawler, ident): def test_synchronization(crawler, ident): insl, updl = crawler.synchronize(commit_changes=False) - assert len(insl) == 0 assert len(updl) == 0 @@ -513,17 +512,23 @@ def test_all_references_are_existing_already2(crawler): crawler.identifiableAdapter.get_registered_identifiable = Mock(side_effect=partial( basic_ident_lookup, idents=registered_identifiables)) + # no reference to check + assert crawler.all_references_are_existing_already(db.Record().add_parent("C")) + # one reference with id assert crawler.all_references_are_existing_already( db.Record().add_parent("C").add_property('a', 123)) - assert crawler.all_references_are_existing_already(db.Record().add_parent("C")) + # one ref with id one with Entity with id assert crawler.all_references_are_existing_already(db.Record().add_parent("D") .add_property('a', 123) .add_property('b', db.Record(id=123))) a = db.Record(name="A").add_parent("C").add_property("a", 12311) + # one ref with id one with Entity without id assert not crawler.all_references_are_existing_already(db.Record().add_parent("D") .add_property('a', 123) .add_property('b', a)) crawler.add_identified_record_to_local_cache(a) + # one ref with id one with Entity which is cached + # (RT C has a as identifying prop which is given in this example) assert crawler.all_references_are_existing_already(db.Record().add_parent("D") .add_property('a', 123) .add_property('b', a))