diff --git a/unittests/test_scalars_cfood.py b/unittests/test_scalars_cfood.py index 42bdcf7fd7ed27d34edf11bd0b0ce9741dff9e1a..57e8ccc4d7804b9d915715e3a8df9e860f988fb0 100644 --- a/unittests/test_scalars_cfood.py +++ b/unittests/test_scalars_cfood.py @@ -67,19 +67,20 @@ def test_handle_value(): assert handle_value([4, 3, 2], store) == ([4, 3, 2], "single") def test_record_structure_generation(crawler): - pass - # Copied from test_tool.py as an example - # subd = crawler.debug_tree[dircheckstr("DataAnalysis")] - # subc = crawler.debug_metadata["copied"][dircheckstr("DataAnalysis")] - # assert len(subd) == 2 - # # variables store on Data Analysis node of debug tree - # assert len(subd[0]) == 2 - # # record store on Data Analysis node of debug tree - # assert len(subd[1]) == 0 - # assert len(subc) == 2 - # assert len(subc[0]) == 2 - # assert len(subc[1]) == 0 - - # # The data analysis node creates one variable for the node itself: - # assert subd[0]["DataAnalysis"] == "examples_article/DataAnalysis" - # assert subc[0]["DataAnalysis"] is False + subd = crawler.debug_tree[dircheckstr("DataAnalysis")] + assert len(subd) == 2 + # variables store on Data Analysis node of debug tree + assert len(subd[0]) == 3 + assert "Data" in subd[0] + assert "DataAnalysis" in subd[0] + assert "RecordThatGetsParentsLater" in subd[0] + + prop = subd[0]["RecordThatGetsParentsLater"].get_property("someId") + assert type(prop.value) == int + assert prop.value == 23 + + # record store on Data Analysis node of debug tree + assert len(subd[1]) == 1 + prop2 = subd[0]["RecordThatGetsParentsLater"].get_property("someId") + assert prop == prop2 +