Skip to content
Snippets Groups Projects
Commit 8666d643 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files
parent d721f2c9
No related branches found
No related tags found
No related merge requests found
Pipeline #35199 passed
......@@ -25,7 +25,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ###
- Query generation when there are only backrefs or backrefs and a name
- [#41](https://gitlab.com/caosdb/caosdb-crawler/-/issues/41)
### Security ###
......
......@@ -193,14 +193,12 @@ class IdentifiableAdapter(metaclass=ABCMeta):
property_name_list_B = []
identifiable_props = {}
identifiable_backrefs = []
name_is_identifying_property = False
if registered_identifiable is not None:
# fill the values:
for prop in registered_identifiable.properties:
if prop.name == "name":
# The name can be an identifiable, but it isn't a property
name_is_identifying_property = True
continue
# problem: what happens with multi properties?
# case A: in the registered identifiable
......@@ -248,7 +246,7 @@ class IdentifiableAdapter(metaclass=ABCMeta):
record_id=record.id,
record_type=(registered_identifiable.parents[0].name
if registered_identifiable else None),
name=record.name if name_is_identifying_property else None,
name=record.name,
properties=identifiable_props,
path=record.path,
backrefs=identifiable_backrefs
......
......@@ -111,19 +111,6 @@ def test_load_from_yaml_file():
assert project_i.get_property("title") is not None
def test_non_default_name():
ident = CaosDBIdentifiableAdapter()
ident.register_identifiable(
"Person", db.RecordType()
.add_parent(name="Person")
.add_property(name="last_name"))
identifiable = ident.get_identifiable(db.Record(name="don't touch it")
.add_parent("Person")
.add_property(name="last_name", value='Tom')
)
assert identifiable.name is None
def test_convert_value():
# test that string representation of objects stay unchanged. No stripping or so.
class A():
......
......@@ -395,7 +395,6 @@ def crawler_mocked_identifiable_retrieve(crawler):
return crawler
@pytest.mark.xfail
def test_split_into_inserts_and_updates_single(crawler_mocked_identifiable_retrieve):
crawler = crawler_mocked_identifiable_retrieve[0]
identlist = [Identifiable(name="A", record_type="C"), Identifiable(name="B", record_type="C")]
......@@ -421,7 +420,6 @@ def test_split_into_inserts_and_updates_single(crawler_mocked_identifiable_retri
crawler.identifiableAdapter.retrieve_identified_record_for_identifiable.assert_called()
@pytest.mark.xfail
def test_split_into_inserts_and_updates_with_duplicate(crawler_mocked_identifiable_retrieve):
crawler = crawler_mocked_identifiable_retrieve[0]
a = db.Record(name="A").add_parent("C")
......@@ -440,7 +438,6 @@ def test_split_into_inserts_and_updates_with_duplicate(crawler_mocked_identifiab
crawler.identifiableAdapter.retrieve_identified_record_for_identifiable.assert_called()
@pytest.mark.xfail
def test_split_into_inserts_and_updates_with_ref(crawler_mocked_identifiable_retrieve):
crawler = crawler_mocked_identifiable_retrieve[0]
# try it with a reference
......@@ -468,7 +465,6 @@ def test_split_into_inserts_and_updates_with_circ(crawler):
# TODO this does not seem to be complete!
@pytest.mark.xfail
def test_split_into_inserts_and_updates_with_complex(crawler_mocked_identifiable_retrieve):
crawler = crawler_mocked_identifiable_retrieve[0]
# A
......@@ -496,7 +492,6 @@ def test_split_into_inserts_and_updates_with_complex(crawler_mocked_identifiable
# TODO write test where the unresoled entity is not part of the identifiable
@pytest.mark.xfail
def test_split_into_inserts_and_updates_with_copy_attr(crawler_mocked_identifiable_retrieve):
crawler = crawler_mocked_identifiable_retrieve[0]
# assume identifiable is only the name
......@@ -514,7 +509,6 @@ def test_split_into_inserts_and_updates_with_copy_attr(crawler_mocked_identifiab
crawler.identifiableAdapter.retrieve_identified_record_for_identifiable.assert_called()
@pytest.mark.xfail
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
......@@ -819,7 +813,6 @@ def test_validation_error_print(caplog):
caplog.clear()
@pytest.mark.xfail
def test_split_into_inserts_and_updates_backref(crawler_mocked_for_backref_test):
crawler = crawler_mocked_for_backref_test[0]
identlist = [Identifiable(name="A", record_type="BR"),
......@@ -854,7 +847,6 @@ def test_split_into_inserts_and_updates_backref(crawler_mocked_for_backref_test)
assert insert[0].name == "B"
@pytest.mark.xfail
def test_split_into_inserts_and_updates_mult_backref(crawler_mocked_for_backref_test):
# test whether multiple references of the same record type are correctly used
crawler = crawler_mocked_for_backref_test[0]
......@@ -875,7 +867,6 @@ def test_split_into_inserts_and_updates_mult_backref(crawler_mocked_for_backref_
assert len(insert) == 2
@pytest.mark.xfail
def test_split_into_inserts_and_updates_diff_backref(crawler_mocked_for_backref_test):
# test whether multiple references of the different record types are correctly used
crawler = crawler_mocked_for_backref_test[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment