From 6ae7034ca2b26cd5554e6b10fb58d357011c08a5 Mon Sep 17 00:00:00 2001
From: Alexander Schlemmer <alexander@mail-schlemmer.de>
Date: Wed, 5 Oct 2022 12:27:42 +0200
Subject: [PATCH] TST: completed the scanner test for handling non-string
 scalars

---
 unittests/test_scalars_cfood.py | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/unittests/test_scalars_cfood.py b/unittests/test_scalars_cfood.py
index 42bdcf7f..57e8ccc4 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
+
-- 
GitLab