Skip to content
Snippets Groups Projects
Commit e38fed98 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: doc and rename test

parent f5086ffa
No related branches found
No related tags found
3 merge requests!71REL: RElease v0.2.0,!56F refactor,!5FIX: use identifiable instead of record
Pipeline #29394 failed
......@@ -193,8 +193,9 @@ class Crawler(object):
Please use SecurityMode Enum
"""
# TODO: check if this feature is really needed
# The following caches store records, where we checked whether they exist on the remote
# server. Since, it is important to know whether they exist or not, we store them into two
# different caches.
self.remote_existing_cache = IdentifiedCache()
self.remote_missing_cache = IdentifiedCache()
self.recordStore = RecordStore()
......@@ -525,10 +526,10 @@ class Crawler(object):
def has_missing_object_in_references(self, record: db.Record):
"""
returns False if any property value is a db.Entity object that does not have an ID and also
is not contained in the local cache. For example, if it was checked before whether such an
db.Entity object existed remotely and it was not found, it would have been added to the
local cache.
returns False if any property value is a db.Entity object that
is contained in the `remote_missing_cache`. If the record has such an object in the
reference properties, it means that it references another Entity, where we checked
whether it exists remotely and it was not found.
"""
for p in record.properties:
# if (is_reference(p)
......
......@@ -498,7 +498,7 @@ def test_split_into_inserts_and_updates_with_copy_attr(crawler_mocked_identifiab
crawler.identifiableAdapter.retrieve_identified_record_for_record.assert_called()
def test_no_uncached_entity_object_in_references(crawler):
def test_has_missing_object_in_references(crawler):
# Simulate remote server content by using the names to identify records
# There are only two known Records with name A and B
crawler.identifiableAdapter.get_registered_identifiable = Mock(side_effect=partial(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment