Skip to content
Snippets Groups Projects
Commit d06d1df5 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: added test for empty parents

parent 545cc670
No related branches found
No related tags found
2 merge requests!71REL: RElease v0.2.0,!38Create fallback parent only when Record object is created
Pipeline #28710 failed
......@@ -83,3 +83,18 @@ def test_substitutions_parents(crawler_2):
assert len(parents) == 2
assert parents[0].name == "Experiment"
assert parents[1].name == "Month_05"
def test_empty_parents(crawler_2):
# This is a test for:
# https://gitlab.com/caosdb/caosdb-crawler/-/issues/8
subd = crawler_2.debug_tree[dircheckstr(
"File", "ExperimentalData", "220512_data.dat")]
parents = subd[1]["RecordWithoutParents"].get_parents()
assert len(parents) == 0
parents = subd[1]["RecordThatGetsParentsLater"].get_parents()
assert len(parents) == 1
assert parents[0].name == "Month_05"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment