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

TST: Added a test for checking variable deletion behavior

parent 6677c5a4
No related branches found
No related tags found
2 merge requests!160STY: styling,!125F delete variables correctly
Pipeline #39011 passed
Data:
type: Directory
match: (.*)
subtree:
Data_1:
type: Directory
match: ^Data_1$
subtree:
Subdir:
type: Directory
match: ^(?P<test_1>.*)$
records:
DummyRecord:
name: "Record from Data_1"
var1: $test_1
var2: $test_2
Data_2:
type: Directory
match: ^Data_2$
subtree:
Subdir:
type: Directory
match: ^(?P<test_2>.*)$
records:
DummyRecord:
name: "Record from Data_2"
var1: $test_1
var2: $test_2
......@@ -245,3 +245,20 @@ def test_record_generation():
persons_found = check_properties(persons, check_props)
for f in persons_found:
assert f > 0
def test_variable_deletion_problems():
debug_tree = DebugTree()
records = scan_directory(UNITTESTDIR / "test_directories" / "example_variable_deletion",
UNITTESTDIR / "cfood_variable_deletion.yml",
debug_tree=debug_tree)
for record in records:
if record.name == "Record from Data_1":
assert record.get_property("var1").value == "bla"
assert record.get_property("var2").value == "$test_2"
elif record.name == "Record from Data_2":
assert record.get_property("var1").value == "$test_1"
assert record.get_property("var2").value == "test"
else:
raise RuntimeError("Wrong name")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment