diff --git a/JsonPreprocessor/JsonPreprocessor.pdf b/JsonPreprocessor/JsonPreprocessor.pdf index e5259fc4..4aa26fec 100644 Binary files a/JsonPreprocessor/JsonPreprocessor.pdf and b/JsonPreprocessor/JsonPreprocessor.pdf differ diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 5bf2f164..128e0e46 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -75,10 +75,15 @@ JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter a JPP_0511|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a list; list index is defined by a parameter JPP_0512|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression JPP_0513|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes +JPP_0514|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing nested dollar operator expressions +JPP_0515|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing nested dollar operator expressions +JPP_0516|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!) JPP_0550|COMPOSITE_EXPRESSIONS|BADCASE|JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside) JPP_0551|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a list; list index is defined by a parameter and wrapped in single quotes JPP_0552|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a list; list index is defined by a parameter and placed inside the curly brackets (invalid syntax) JPP_0553|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a list; list index is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax) +JPP_0554|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a dictionary; the dictionary key is defined by a parameter and placed inside the curly brackets (invalid syntax) +JPP_0555|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a dictionary; the dictionary key is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax) JPP_0600|CODE_COMMENTS|GOODCASE|JSON file with several combinations of code comments JPP_0950|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (1) JPP_0951|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (2) @@ -88,6 +93,7 @@ JPP_0954|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (5): file JPP_1000|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly JPP_1001|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly (same key names at all levels) JPP_1002|IMPLICIT_CREATION|GOODCASE|JSON file with combinations of implicit and explicit creation / with and without initialization +JPP_1003|IMPLICIT_CREATION|GOODCASE|JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference JPP_1050|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (1) JPP_1051|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (2) JPP_1052|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (3) diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index 87519d94..0d6a24ac 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -2539,6 +2539,105 @@ 76 + + + +JPP_0514 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing nested dollar operator expressions
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +77 + + + + + +JPP_0515 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing nested dollar operator expressions
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +78 + + + + + +JPP_0516 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!)
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +79 + + @@ -2570,7 +2669,7 @@ -77 +80 @@ -2604,7 +2703,7 @@ -78 +81 @@ -2637,7 +2736,7 @@ -79 +82 @@ -2670,7 +2769,73 @@ -80 +83 + + + + + +JPP_0554 + + + + +COMPOSITE_EXPRESSIONS + + + + +BADCASE + + + + +JSON file containing a dictionary; the dictionary key is defined by a parameter and placed inside the curly brackets (invalid syntax)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +84 + + + + + +JPP_0555 + + + + +COMPOSITE_EXPRESSIONS + + + + +BADCASE + + + + +JSON file containing a dictionary; the dictionary key is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +85 @@ -2703,7 +2868,7 @@ -81 +86 @@ -2736,7 +2901,7 @@ -82 +87 @@ -2769,7 +2934,7 @@ -83 +88 @@ -2802,7 +2967,7 @@ -84 +89 @@ -2835,7 +3000,7 @@ -85 +90 @@ -2868,7 +3033,7 @@ -86 +91 @@ -2901,7 +3066,7 @@ -87 +92 @@ -2934,7 +3099,7 @@ -88 +93 @@ -2967,7 +3132,40 @@ -89 +94 + + + + + +JPP_1003 + + + + +IMPLICIT_CREATION + + + + +GOODCASE + + + + +JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference
+Expected: JsonPreprocessor returns values + + +
+ + + + + + + +95 @@ -3000,7 +3198,7 @@ -90 +96 @@ -3033,7 +3231,7 @@ -91 +97 @@ -3066,7 +3264,7 @@ -92 +98 @@ -3099,7 +3297,7 @@ -93 +99 @@ -3132,7 +3330,7 @@ -94 +100 @@ -3165,7 +3363,7 @@ -95 +101 @@ -3198,7 +3396,7 @@ -96 +102 @@ -3231,7 +3429,7 @@ -97 +103 @@ -3264,7 +3462,7 @@ -98 +104 @@ -3297,7 +3495,7 @@ -99 +105 @@ -3330,7 +3528,7 @@ -100 +106 @@ -3364,7 +3562,7 @@
 

-
Generated: 24.01.2024 - 13:56:16
+
Generated: 07.03.2024 - 14:58:30
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index adf38a52..6df52fa5 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -825,6 +825,36 @@ Test Use Cases ---- +* **Test JPP_0514** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing nested dollar operator expressions** + + Expected: JsonPreprocessor returns expected value + +---- + +* **Test JPP_0515** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing nested dollar operator expressions** + + Expected: JsonPreprocessor returns expected value + +---- + +* **Test JPP_0516** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!)** + + Expected: JsonPreprocessor returns expected value + +---- + * **Test JPP_0550** [COMPOSITE_EXPRESSIONS / BADCASE] @@ -869,6 +899,26 @@ Test Use Cases ---- +* **Test JPP_0554** + + [COMPOSITE_EXPRESSIONS / BADCASE] + + **JSON file containing a dictionary; the dictionary key is defined by a parameter and placed inside the curly brackets (invalid syntax)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0555** + + [COMPOSITE_EXPRESSIONS / BADCASE] + + **JSON file containing a dictionary; the dictionary key is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0600** [CODE_COMMENTS / GOODCASE] @@ -959,6 +1009,16 @@ Test Use Cases ---- +* **Test JPP_1003** + + [IMPLICIT_CREATION / GOODCASE] + + **JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference** + + Expected: JsonPreprocessor returns values + +---- + * **Test JPP_1050** [IMPLICIT_CREATION / BADCASE] @@ -1081,5 +1141,5 @@ Test Use Cases ---- -Generated: 24.01.2024 - 13:56:16 +Generated: 07.03.2024 - 14:58:30 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index da3890e1..cbb9dd45 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -345,6 +345,18 @@ Test JPP_0513 / COMPOSITE_EXPRESSIONS / GOODCASE Description: JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes Expectation: JsonPreprocessor returns expected value ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0514 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing nested dollar operator expressions +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0515 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing nested dollar operator expressions +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0516 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!) +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ Test JPP_0550 / COMPOSITE_EXPRESSIONS / BADCASE Description: JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -363,6 +375,14 @@ Test JPP_0553 / COMPOSITE_EXPRESSIONS / BADCASE Description: JSON file containing a list; list index is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax) Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0554 / COMPOSITE_EXPRESSIONS / BADCASE +Description: JSON file containing a dictionary; the dictionary key is defined by a parameter and placed inside the curly brackets (invalid syntax) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0555 / COMPOSITE_EXPRESSIONS / BADCASE +Description: JSON file containing a dictionary; the dictionary key is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_0600 / CODE_COMMENTS / GOODCASE Description: JSON file with several combinations of code comments Expectation: JsonPreprocessor returns remaining content of JSON file (valid parameters) @@ -399,6 +419,10 @@ Test JPP_1002 / IMPLICIT_CREATION / GOODCASE Description: JSON file with combinations of implicit and explicit creation / with and without initialization Expectation: JsonPreprocessor returns values ------------------------------------------------------------------------------------------------------------------------ +Test JPP_1003 / IMPLICIT_CREATION / GOODCASE +Description: JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference +Expectation: JsonPreprocessor returns values +------------------------------------------------------------------------------------------------------------------------ Test JPP_1050 / IMPLICIT_CREATION / BADCASE Description: JSON file with implicit creation of data structures based on parameters (1) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -448,5 +472,5 @@ Description: Relative path to JSON file Expectation: JsonPreprocessor resolves the relative path and returns values from JSON file Hint.......: Works with raw path to JSON file (path not normalized internally) ------------------------------------------------------------------------------------------------------------------------ -Generated: 24.01.2024 - 13:56:16 +Generated: 07.03.2024 - 14:58:30 diff --git a/test/component_test.py b/test/component_test.py index c2cac44b..07c4b497 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,8 +22,8 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.26.0" -VERSION_DATE = "05.02.2024" +VERSION = "0.28.0" +VERSION_DATE = "07.03.2024" # # -------------------------------------------------------------------------------------------------------------- #TM*** diff --git a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py index 39b14554..7f7e18bc 100644 --- a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 15.01.2024 - 16:29:04 +# 07.03.2024 - 14:58:30 # # -------------------------------------------------------------------------------------------------------------- @@ -133,4 +133,28 @@ def test_JPP_0512(self, Description): def test_JPP_0513(self, Description): nReturn = CExecute.Execute("JPP_0513") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing nested dollar operator expressions",] + ) + def test_JPP_0514(self, Description): + nReturn = CExecute.Execute("JPP_0514") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing nested dollar operator expressions",] + ) + def test_JPP_0515(self, Description): + nReturn = CExecute.Execute("JPP_0515") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!)",] + ) + def test_JPP_0516(self, Description): + nReturn = CExecute.Execute("JPP_0516") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_08_COMPOSITE_EXPRESSIONS_BADCASE.py b/test/pytest/pytestfiles/test_08_COMPOSITE_EXPRESSIONS_BADCASE.py index ef966733..f3762099 100644 --- a/test/pytest/pytestfiles/test_08_COMPOSITE_EXPRESSIONS_BADCASE.py +++ b/test/pytest/pytestfiles/test_08_COMPOSITE_EXPRESSIONS_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 24.01.2024 - 13:56:16 +# 06.03.2024 - 15:51:02 # # -------------------------------------------------------------------------------------------------------------- @@ -61,4 +61,20 @@ def test_JPP_0552(self, Description): def test_JPP_0553(self, Description): nReturn = CExecute.Execute("JPP_0553") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file containing a dictionary; the dictionary key is defined by a parameter and placed inside the curly brackets (invalid syntax)",] + ) + def test_JPP_0554(self, Description): + nReturn = CExecute.Execute("JPP_0554") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file containing a dictionary; the dictionary key is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax)",] + ) + def test_JPP_0555(self, Description): + nReturn = CExecute.Execute("JPP_0555") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py b/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py index 3e708064..996c5720 100644 --- a/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py +++ b/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 16.01.2024 - 13:22:08 +# 07.03.2024 - 14:58:30 # # -------------------------------------------------------------------------------------------------------------- @@ -53,4 +53,12 @@ def test_JPP_1001(self, Description): def test_JPP_1002(self, Description): nReturn = CExecute.Execute("JPP_1002") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns values + @pytest.mark.parametrize( + "Description", ["JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference",] + ) + def test_JPP_1003(self, Description): + nReturn = CExecute.Execute("JPP_1003") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index fba019ba..221df1ba 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -22,7 +22,7 @@ # # -------------------------------------------------------------------------------------------------------------- # -# 04.03.2024 +# 07.03.2024 # # !!! Temporarily tests are deactivated by the following line commented out: # # # listofdictUsecases.append(dictUsecase) @@ -1855,7 +1855,7 @@ dictUsecase['SUBSECTION'] = "GOODCASE" dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None -dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0504.jsonp" +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0504.jsonp" # current issue: Expecting value: line 20 column 14 (char 1088)'! dictUsecase['EXPECTEDEXCEPTION'] = None dictUsecase['EXPECTEDRETURN'] = """ [DICT] (20/1) > {param1} [DICT] (1/1) > {A} [DICT] (1/1) > {B} [DICT] (1/1) > {C} [DICT] (1/1) > {D} [FLOAT] : 1.23 @@ -2085,8 +2085,14 @@ dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0514.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = None -dictUsecase['EXPECTEDRETURN'] = None # list index out of range -# # # listofdictUsecases.append(dictUsecase) +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (5/1) > {keyP} [STR] : 'A' +[DICT] (5/2) > {B} [INT] : 1 +[DICT] (5/3) > {dictP} [DICT] (2/1) > {A} [STR] : 'B' +[DICT] (5/3) > {dictP} [DICT] (2/2) > {C} [INT] : 2 +[DICT] (5/4) > {newparam_1} [STR] : '1' +[DICT] (5/5) > {newparam_2} [STR] : '1'""" +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -2099,8 +2105,46 @@ dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0515.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = None -dictUsecase['EXPECTEDRETURN'] = None # freeze -# # # listofdictUsecases.append(dictUsecase) +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (12/1) > {keyP} [STR] : 'A' +[DICT] (12/2) > {B} [STR] : 'keyP' +[DICT] (12/3) > {dictP} [DICT] (1/1) > {A} [STR] : 'B' +[DICT] (12/4) > {newparam_1} [STR] : 'B' +[DICT] (12/5) > {newparam_2} [STR] : 'keyP' +[DICT] (12/6) > {newparam_3} [STR] : 'A' +[DICT] (12/7) > {newparam_4} [STR] : 'B' +[DICT] (12/8) > {newparam_5} [STR] : 'keyP' +[DICT] (12/9) > {newparam_6} [STR] : 'A' +[DICT] (12/10) > {newparam_7} [STR] : 'B' +[DICT] (12/11) > {newparam_8} [STR] : 'keyP' +[DICT] (12/12) > {newparam_9} [STR] : 'A'""" +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0516" +dictUsecase['DESCRIPTION'] = "JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!)" +dictUsecase['EXPECTATION'] = "JsonPreprocessor returns expected value" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "GOODCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0516.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (9/1) > {listparam} [LIST] (3/1) > [STR] : 'A' +[DICT] (9/1) > {listparam} [LIST] (3/2) > [STR] : 'B' +[DICT] (9/1) > {listparam} [LIST] (3/3) > [STR] : 'C' +[DICT] (9/2) > {param_1} [STR] : '}A{' +[DICT] (9/3) > {param_2} [STR] : '{A}' +[DICT] (9/4) > {param_3} [STR] : '$}A$}' +[DICT] (9/5) > {param_4} [STR] : '{$}A{$}' +[DICT] (9/6) > {param_5} [STR] : '}{$}A{$}{' +[DICT] (9/7) > {param_6} [STR] : '{}{$}A{$}{}' +[DICT] (9/8) > {param_7} [STR] : '{}A{$}B{$}C{}' +[DICT] (9/9) > {param_8} [STR] : '{}$A{$$}$B{$$}$C{}' +""" +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -2169,9 +2213,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0554.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -2183,9 +2227,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0555.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = None # !!! currently freeze pf JPP !!! https://github.com/test-fullautomation/python-jsonpreprocessor/issues/226 +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -2371,9 +2415,9 @@ del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} -# >>>>>>>>>>>>>>>>>>>>>>>>> currently fail +# ====== still one line in jpp-test_config_1003.jsonp commented out; remaining code run properly dictUsecase['TESTID'] = "JPP_1003" -dictUsecase['DESCRIPTION'] = "JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters" +dictUsecase['DESCRIPTION'] = "JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference" dictUsecase['EXPECTATION'] = "JsonPreprocessor returns values" dictUsecase['SECTION'] = "IMPLICIT_CREATION" dictUsecase['SUBSECTION'] = "GOODCASE" @@ -2388,9 +2432,9 @@ [DICT] (7/4) > {param3} [STR] : 'subKey3' [DICT] (7/5) > {param4} [STR] : 'subKey4' [DICT] (7/6) > {param5} [INT] : 3 -[DICT] (7/7) > {testdict1} [DICT] (1/1) > {subKey1} [DICT] (1/1) > {subKey2} [DICT] (1/1) > {subKey3} [DICT] (1/1) > {subKey4} [INT] : 2 +[DICT] (7/7) > {testdict1} [DICT] (1/1) > {subKey1} [DICT] (1/1) > {subKey2} [DICT] (1/1) > {subKey3} [DICT] (1/1) > {subKey4} [INT] : 3 """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testfiles/jpp-test_config_0515.jsonp b/test/testfiles/jpp-test_config_0515.jsonp index a3835990..14251b52 100644 --- a/test/testfiles/jpp-test_config_0515.jsonp +++ b/test/testfiles/jpp-test_config_0515.jsonp @@ -17,9 +17,14 @@ "B" : "keyP", "dictP" : {"A" : "B"}, // - "newparam_1" : "${dictP}['${keyP}']", // => "${dictP}['A']" -> 'B' - "newparam_2" : "${${dictP}['${keyP}']}", // => "${B}" -> 'keyP' - "newparam_3" : "${${${dictP}['${keyP}']}}", // => "${keyP}" -> 'A' - "newparam_4" : "${dictP}['${${${dictP}['${keyP}']}}']" // => "${dictP}['A']" -> !!! freeze !!! + "newparam_1" : "${dictP}['${keyP}']", // => "${dictP}['A']" -> 'B' + "newparam_2" : "${${dictP}['${keyP}']}", // => "${B}" -> 'keyP' + "newparam_3" : "${${${dictP}['${keyP}']}}", // => "${keyP}" -> 'A' + "newparam_4" : "${dictP}['${${${dictP}['${keyP}']}}']", // => "${dictP}['A']" -> 'B' + "newparam_5" : "${${dictP}['${${${dictP}['${keyP}']}}']}", // => "${B}" -> 'keyP' + "newparam_6" : "${${${dictP}['${${${dictP}['${keyP}']}}']}}", // => "${keyP}" -> 'A' + "newparam_7" : "${dictP}['${${${dictP}['${${${dictP}['${keyP}']}}']}}']", // => "${dictP}['A']" -> 'B' + "newparam_8" : "${${dictP}['${${${dictP}['${${${dictP}['${keyP}']}}']}}']}", // => "${B}" -> 'keyP' + "newparam_9" : "${${${dictP}['${${${dictP}['${${${dictP}['${keyP}']}}']}}']}}" // => "${keyP}" -> 'A' } diff --git a/test/testfiles/jpp-test_config_0956.jsonp b/test/testfiles/jpp-test_config_0516.jsonp similarity index 61% rename from test/testfiles/jpp-test_config_0956.jsonp rename to test/testfiles/jpp-test_config_0516.jsonp index ce198816..7ce4a176 100644 --- a/test/testfiles/jpp-test_config_0956.jsonp +++ b/test/testfiles/jpp-test_config_0516.jsonp @@ -13,6 +13,14 @@ // limitations under the License. //************************************************************************** { - "param1" : "value", - "param2" : ${param1}[0] + "listparam" : ["A","B","C"], + "param_1" : "}${listparam}[0]{", + "param_2" : "{${listparam}[0]}", + "param_3" : "$}${listparam}[0]$}", + "param_4" : "{$}${listparam}[0]{$}", + "param_5" : "}{$}${listparam}[0]{$}{", + "param_6" : "{}{$}${listparam}[0]{$}{}", + "param_7" : "{}${listparam}[0]{$}${listparam}[1]{$}${listparam}[2]{}", + "param_8" : "{}$${listparam}[0]{$$}$${listparam}[1]{$$}$${listparam}[2]{}" } + diff --git a/test/testfiles/jpp-test_config_1003.jsonp b/test/testfiles/jpp-test_config_1003.jsonp index fffc84a2..b0c5715a 100644 --- a/test/testfiles/jpp-test_config_1003.jsonp +++ b/test/testfiles/jpp-test_config_1003.jsonp @@ -16,7 +16,7 @@ { // implicitly created data structure ${testdict1.subKey1.subKey2.subKey3} : {"subKey4" : 1}, - "testdict2" : ${testdict1}, // by value + "testdict2" : ${testdict1}, // by reference // // parameters containing names of existing keys "param1" : "subKey1", @@ -30,6 +30,8 @@ ${testdict2.${param1}.subKey2.${param3}.subKey4} : 3, // assign modified values to new parameters "param5" : ${testdict1}[${param1}]['${param2}']['subKey3'][${param4}] - // "param6" : ${testdict2.${param1}.subKey2.${param3}.subKey4} // 'Invalid nested parameter format: ${testdict2.${param1}.subKey2.${param3}.subKey4} - The double quotes are missing!!!'! + + // still issue: + // "param6" : ${testdict2.${param1}.subKey2.${param3}.subKey4} // Expecting value: line 11 column 15 (char 412)'! }