Skip to content
Snippets Groups Projects
Commit 3a5b3cf7 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

TEST(identifiable): Remove unused test case

parent 63a01e6b
No related branches found
No related tags found
2 merge requests!222Release 0.12.0,!218Multiple registered identifiables error when multiple parents exist
Pipeline #62057 passed
......@@ -54,6 +54,8 @@ def mock_retrieve_RecordType(id, name):
"Lab": db.RecordType(name="Lab"),
"Analysis": db.RecordType(name="Analysis"),
"MetaAnalysis": db.RecordType(name="MetaAnalysis").add_parent("Analysis"),
# Test that two parents are possible; only one of them
# (Experiment) has an identifiable.
"Measurement": db.RecordType(name="Measurement").add_parent("Experiment").add_parent("A")
}[name]
......@@ -330,16 +332,10 @@ def test_get_registered_identifiable():
with pytest.raises(RuntimeError):
registered = ident.get_registered_identifiable(rec)
# Test the case that the record has a parent for which no identifiable is registered
# and there is a registered identifiable for a grand parent
ident = CaosDBIdentifiableAdapter()
ident.load_from_yaml_definition(UNITTESTDIR / "example_identifiables.yml")
rec = db.Record().add_parent(name="Measurement")
registered = ident.get_registered_identifiable(rec)
assert registered is not None
assert registered.parents[0].name == "Experiment"
# Same again, but with two grand parents
# Test the case that the record has a parent for which no
# identifiable is registered and there is a registered
# identifiable for a grand parent. Note that this also tests the
# case of two grandparents, only one of which has an identifiable.
ident = CaosDBIdentifiableAdapter()
ident.load_from_yaml_definition(UNITTESTDIR / "example_identifiables.yml")
rec = db.Record().add_parent(name="Measurement")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment