From 59c3611202fdc2c6c07364cc2455ac37072ba028 Mon Sep 17 00:00:00 2001 From: qth2hi Date: Tue, 9 Jan 2024 11:53:35 +0100 Subject: [PATCH 1/3] Added BADCASE tests for the "implict creation" feature: JPP_1050 - JPP_1057 --- test/JPP_TestUsecases.csv | 8 + test/JPP_TestUsecases.html | 270 +++++++++++++++++- test/JPP_TestUsecases.rst | 82 +++++- test/JPP_TestUsecases.txt | 34 ++- test/component_test.py | 4 +- .../test_12_IMPLICIT_CREATION_BADCASE.py | 96 +++++++ ...E.py => test_13_CYCLIC_IMPORTS_BADCASE.py} | 4 +- ...SE.py => test_14_PATH_FORMATS_GOODCASE.py} | 4 +- test/testconfig/TestConfig.py | 124 +++++++- ...-test_config_implicit_creation.1.1.1.jsonp | 9 - test/testfiles/jpp-test_config_1001.jsonp | 13 +- test/testfiles/jpp-test_config_1050.jsonp | 21 ++ test/testfiles/jpp-test_config_1051.jsonp | 21 ++ test/testfiles/jpp-test_config_1052.jsonp | 21 ++ test/testfiles/jpp-test_config_1053.jsonp | 21 ++ test/testfiles/jpp-test_config_1054.jsonp | 21 ++ test/testfiles/jpp-test_config_1055.jsonp | 21 ++ test/testfiles/jpp-test_config_1056.jsonp | 21 ++ test/testfiles/jpp-test_config_1057.jsonp | 21 ++ 19 files changed, 785 insertions(+), 31 deletions(-) create mode 100644 test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py rename test/pytest/pytestfiles/{test_12_CYCLIC_IMPORTS_BADCASE.py => test_13_CYCLIC_IMPORTS_BADCASE.py} (97%) rename test/pytest/pytestfiles/{test_13_PATH_FORMATS_GOODCASE.py => test_14_PATH_FORMATS_GOODCASE.py} (96%) create mode 100644 test/testfiles/jpp-test_config_1050.jsonp create mode 100644 test/testfiles/jpp-test_config_1051.jsonp create mode 100644 test/testfiles/jpp-test_config_1052.jsonp create mode 100644 test/testfiles/jpp-test_config_1053.jsonp create mode 100644 test/testfiles/jpp-test_config_1054.jsonp create mode 100644 test/testfiles/jpp-test_config_1055.jsonp create mode 100644 test/testfiles/jpp-test_config_1056.jsonp create mode 100644 test/testfiles/jpp-test_config_1057.jsonp diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 0e4d7cd3..544ffd9b 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -78,6 +78,14 @@ JPP_0953|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (4): file JPP_0954|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (5): file is empty (multiple pairs of brackets only) 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_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) +JPP_1053|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (4) +JPP_1054|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (5) +JPP_1055|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (5) +JPP_1056|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (6) +JPP_1057|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (7) JPP_1150|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports itself) JPP_1151|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports another file, that is already imported) JPP_1200|PATH_FORMATS|GOODCASE|Relative path to JSON file diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index e37e35da..2136df85 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -2638,6 +2638,270 @@ 79 + + + +JPP_1050 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (1)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +80 + + + + + +JPP_1051 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (2)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +81 + + + + + +JPP_1052 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (3)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +82 + + + + + +JPP_1053 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (4)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +83 + + + + + +JPP_1054 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (5)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +84 + + + + + +JPP_1055 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (5)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +85 + + + + + +JPP_1056 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (6)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +86 + + + + + +JPP_1057 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file with implicit creation of data structures based on parameters (7)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +87 + + @@ -2668,7 +2932,7 @@ -80 +88 @@ -2701,7 +2965,7 @@ -81 +89 @@ -2735,7 +2999,7 @@
 

-
Generated: 20.11.2023 - 15:42:16
+
Generated: 09.01.2024 - 11:50:58
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index b8213208..b37a5f13 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -855,6 +855,86 @@ Test Use Cases ---- +* **Test JPP_1050** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (1)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1051** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (2)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1052** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (3)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1053** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (4)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1054** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (5)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1055** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (5)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1056** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (6)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_1057** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file with implicit creation of data structures based on parameters (7)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_1150** [CYCLIC_IMPORTS / BADCASE] @@ -887,5 +967,5 @@ Test Use Cases ---- -Generated: 20.11.2023 - 15:42:16 +Generated: 09.01.2024 - 11:50:58 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index 41d51a22..c06d4d07 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -357,6 +357,38 @@ Test JPP_1001 / IMPLICIT_CREATION / GOODCASE Description: JSON file with dictionary keys to be created implicitly (same key names at all levels) 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 +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1051 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (2) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1052 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (3) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1053 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (4) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1054 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (5) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1055 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (5) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1056 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (6) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_1057 / IMPLICIT_CREATION / BADCASE +Description: JSON file with implicit creation of data structures based on parameters (7) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_1150 / CYCLIC_IMPORTS / BADCASE Description: JSON file with cyclic imports (JSON file imports itself) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -370,5 +402,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: 20.11.2023 - 15:42:16 +Generated: 09.01.2024 - 11:50:58 diff --git a/test/component_test.py b/test/component_test.py index c4de2027..2af5d8b8 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,8 +22,8 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.20.0" -VERSION_DATE = "14.12.2023" +VERSION = "0.21.0" +VERSION_DATE = "09.01.2024" # # -------------------------------------------------------------------------------------------------------------- #TM*** diff --git a/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py b/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py new file mode 100644 index 00000000..68f98ff4 --- /dev/null +++ b/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py @@ -0,0 +1,96 @@ +# ************************************************************************************************************** +# Copyright 2020-2023 Robert Bosch GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -------------------------------------------------------------------------------------------------------------- +# +# test_12_IMPLICIT_CREATION_BADCASE.py +# +# XC-CT/ECA3-Queckenstedt +# +# 09.01.2024 - 11:50:58 +# +# -------------------------------------------------------------------------------------------------------------- + +import pytest +from pytestlibs.CExecute import CExecute + +# -------------------------------------------------------------------------------------------------------------- + +class Test_IMPLICIT_CREATION_BADCASE: + +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (1)",] + ) + def test_JPP_1050(self, Description): + nReturn = CExecute.Execute("JPP_1050") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (2)",] + ) + def test_JPP_1051(self, Description): + nReturn = CExecute.Execute("JPP_1051") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (3)",] + ) + def test_JPP_1052(self, Description): + nReturn = CExecute.Execute("JPP_1052") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (4)",] + ) + def test_JPP_1053(self, Description): + nReturn = CExecute.Execute("JPP_1053") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (5)",] + ) + def test_JPP_1054(self, Description): + nReturn = CExecute.Execute("JPP_1054") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (5)",] + ) + def test_JPP_1055(self, Description): + nReturn = CExecute.Execute("JPP_1055") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (6)",] + ) + def test_JPP_1056(self, Description): + nReturn = CExecute.Execute("JPP_1056") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with implicit creation of data structures based on parameters (7)",] + ) + def test_JPP_1057(self, Description): + nReturn = CExecute.Execute("JPP_1057") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_12_CYCLIC_IMPORTS_BADCASE.py b/test/pytest/pytestfiles/test_13_CYCLIC_IMPORTS_BADCASE.py similarity index 97% rename from test/pytest/pytestfiles/test_12_CYCLIC_IMPORTS_BADCASE.py rename to test/pytest/pytestfiles/test_13_CYCLIC_IMPORTS_BADCASE.py index 7601d111..c38a70a3 100644 --- a/test/pytest/pytestfiles/test_12_CYCLIC_IMPORTS_BADCASE.py +++ b/test/pytest/pytestfiles/test_13_CYCLIC_IMPORTS_BADCASE.py @@ -14,11 +14,11 @@ # limitations under the License. # -------------------------------------------------------------------------------------------------------------- # -# test_12_CYCLIC_IMPORTS_BADCASE.py +# test_13_CYCLIC_IMPORTS_BADCASE.py # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 09.01.2024 - 11:50:58 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_13_PATH_FORMATS_GOODCASE.py b/test/pytest/pytestfiles/test_14_PATH_FORMATS_GOODCASE.py similarity index 96% rename from test/pytest/pytestfiles/test_13_PATH_FORMATS_GOODCASE.py rename to test/pytest/pytestfiles/test_14_PATH_FORMATS_GOODCASE.py index e5d97ecf..089c0276 100644 --- a/test/pytest/pytestfiles/test_13_PATH_FORMATS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_14_PATH_FORMATS_GOODCASE.py @@ -14,11 +14,11 @@ # limitations under the License. # -------------------------------------------------------------------------------------------------------------- # -# test_13_PATH_FORMATS_GOODCASE.py +# test_14_PATH_FORMATS_GOODCASE.py # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 09.01.2024 - 11:50:58 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index 0f8d3e72..bad4926f 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -22,7 +22,7 @@ # # -------------------------------------------------------------------------------------------------------------- # -# 14.12.2023 +# 09.01.2024 # # !!! Temporarily tests are deactivated by the following line commented out: # # # listofdictUsecases.append(dictUsecase) @@ -2142,15 +2142,6 @@ [DICT] (2/1) > {dTestDict} [DICT] (5/5) > {kVal_4} [DICT] (1/1) > {kVal_4B} [DICT] (1/1) > {kVal_4C} [DICT] (3/3) > {kVal_4D} [DICT] (1/1) > {kVal_4E} [DICT] (1/1) > {kVal_4F} [DICT] (1/1) > {kVal_4G} [DICT] (2/2) > {D} [LIST] (2/2) > [INT] : 4 [DICT] (2/2) > {Val_1_extended} [STR] : 'Val_1' """ -# Comment out these test result due to the implicit creation of data structures based on nested parameters is temporary disabled. -# [DICT] (4/1) > {dTestDict} [DICT] (6/6) > {kVal_5} [DICT] (1/1) > {kVal_5B} [DICT] (3/1) > {E} [INT] : 3 -# [DICT] (4/1) > {dTestDict} [DICT] (6/6) > {kVal_5} [DICT] (1/1) > {kVal_5B} [DICT] (3/2) > {F} [LIST] (2/1) > [INT] : 5 -# [DICT] (4/1) > {dTestDict} [DICT] (6/6) > {kVal_5} [DICT] (1/1) > {kVal_5B} [DICT] (3/2) > {F} [LIST] (2/2) > [INT] : 6 -# [DICT] (4/1) > {dTestDict} [DICT] (6/6) > {kVal_5} [DICT] (1/1) > {kVal_5B} [DICT] (3/3) > {kVal_5C} [DICT] (2/1) > {G} [INT] : 4 -# [DICT] (4/1) > {dTestDict} [DICT] (6/6) > {kVal_5} [DICT] (1/1) > {kVal_5B} [DICT] (3/3) > {kVal_5C} [DICT] (2/2) > {H} [LIST] (2/1) > [INT] : 7 -# [DICT] (4/1) > {dTestDict} [DICT] (6/6) > {kVal_5} [DICT] (1/1) > {kVal_5B} [DICT] (3/3) > {kVal_5C} [DICT] (2/2) > {H} [LIST] (2/2) > [INT] : 8 -# [DICT] (4/2) > {kVal_5B_name} [STR] : 'kVal_5B' -# [DICT] (4/3) > {kVal_5C_name} [STR] : 'kVal_5C' listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- @@ -2175,6 +2166,119 @@ # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1050" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (1)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1050.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1051" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (2)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1051.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1052" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (3)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1052.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1053" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (4)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1053.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None # test case currently causes a crash of the JsonPreprocessor; 'EXPECTEDEXCEPTION' needs to be defined after bug is fixed +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1054" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (5)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1054.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None # test case currently causes a crash of the JsonPreprocessor; 'EXPECTEDEXCEPTION' needs to be defined after bug is fixed +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1055" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (5)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1055.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None # test case currently causes a crash of the JsonPreprocessor; 'EXPECTEDEXCEPTION' needs to be defined after bug is fixed +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1056" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (6)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1056.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" # currently causes : ''NoneType' object has no attribute 'group''! +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1057" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (7)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1057.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" # currently values are returned with unresolved dollar operator expressions +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} dictUsecase['TESTID'] = "JPP_1150" dictUsecase['DESCRIPTION'] = "JSON file with cyclic imports (JSON file imports itself)" dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" diff --git a/test/testfiles/import/import.1/import.1.1/jpp-test_config_implicit_creation.1.1.1.jsonp b/test/testfiles/import/import.1/import.1.1/jpp-test_config_implicit_creation.1.1.1.jsonp index 54bd88a9..0ad12b4c 100644 --- a/test/testfiles/import/import.1/import.1.1/jpp-test_config_implicit_creation.1.1.1.jsonp +++ b/test/testfiles/import/import.1/import.1.1/jpp-test_config_implicit_creation.1.1.1.jsonp @@ -19,14 +19,5 @@ // mixture of dotdict and standard notation: ${dTestDict.kVal_4}['kVal_4B']['kVal_4C'] : {"A" : 1, "B" : [1,2]}, ${dTestDict.kVal_4.kVal_4B.kVal_4C.kVal_4D.kVal_4E}['kVal_4F']['kVal_4G'] : {"C" : 2, "D" : [3,4]} - // sub key defined by parameter: (Temporary disable implicit creation of data structures based on nested parameters) - // "kVal_5B_name" : "kVal_5B", - // "kVal_5C_name" : "kVal_5C", - // ${dTestDict.kVal_5.${kVal_5B_name}} : {"E" : 3, "F" : [5,6]}, - // ${dTestDict.kVal_5}['${kVal_5B_name}']['${kVal_5C_name}'] : {"G" : 4, "H" : [7,8]} - // - // invalid parameter format (reference: https://github.com/test-fullautomation/python-jsonpreprocessor/issues/153) - // ${dTestDict.${kVal_5B_name}.${kVal_5C_name}.kVal_5D} : {"M" : 5, "N" : [0,9]} - // ${dTestDict.${kVal_5B_name}.${kVal_5C_name}}['kVal_5D'] : {"M" : 5, "N" : [0,9]} } diff --git a/test/testfiles/jpp-test_config_1001.jsonp b/test/testfiles/jpp-test_config_1001.jsonp index bbb17486..02ed0c06 100644 --- a/test/testfiles/jpp-test_config_1001.jsonp +++ b/test/testfiles/jpp-test_config_1001.jsonp @@ -23,7 +23,6 @@ "subkey" : { "paramA" : "ABC", ${param3.subkey.subkey.paramA} : "DEF", - // https://github.com/test-fullautomation/robotframework-testsuitesmanagement/issues/224 "paramA" : ${param2.subkey.subkey.subkey}, "paramB" : "XYZ", ${param3.subkey.subkey.paramB} : ${param2.subkey.subkey.subkey} @@ -31,3 +30,15 @@ } } } + +// Caution: +// The implicit creation of data structures is only possible with hard coded key names. Parameters are not resolved. +// See: +// "paramA" : "ABC", +// ${param3.subkey.subkey.paramA} : "DEF", +// The name of the last implicitely created key within the expression ${param3.subkey.subkey.paramA} +// is "paramA", and not the value "ABC" of the parameter with the same name ("paramA"). + + + + diff --git a/test/testfiles/jpp-test_config_1050.jsonp b/test/testfiles/jpp-test_config_1050.jsonp new file mode 100644 index 00000000..321a056a --- /dev/null +++ b/test/testfiles/jpp-test_config_1050.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "testdict" : {"A" : 1}, + "name" : "C", + ${testdict.B}['${name}'] : 2 +} + diff --git a/test/testfiles/jpp-test_config_1051.jsonp b/test/testfiles/jpp-test_config_1051.jsonp new file mode 100644 index 00000000..1d63e26b --- /dev/null +++ b/test/testfiles/jpp-test_config_1051.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "testdict" : {"A" : 1}, + "name" : "C", + ${testdict.B.${name}} : 2 +} + diff --git a/test/testfiles/jpp-test_config_1052.jsonp b/test/testfiles/jpp-test_config_1052.jsonp new file mode 100644 index 00000000..4028d7da --- /dev/null +++ b/test/testfiles/jpp-test_config_1052.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "testdict" : {"A" : 1}, + "name" : "C", + ${testdict}['${name}']['${name}'] : 2 +} + diff --git a/test/testfiles/jpp-test_config_1053.jsonp b/test/testfiles/jpp-test_config_1053.jsonp new file mode 100644 index 00000000..29b69f56 --- /dev/null +++ b/test/testfiles/jpp-test_config_1053.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "name" : "C", + "testdict2" : {"B" : 2}, + ${somethingnotexisting.${testdict2}}['${name}'] : 4 +} + diff --git a/test/testfiles/jpp-test_config_1054.jsonp b/test/testfiles/jpp-test_config_1054.jsonp new file mode 100644 index 00000000..60fcd02e --- /dev/null +++ b/test/testfiles/jpp-test_config_1054.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "name" : "C", + "testdict" : {"B" : 2}, + ${testdict.${testdict}}['${name}'] : 4 +} + diff --git a/test/testfiles/jpp-test_config_1055.jsonp b/test/testfiles/jpp-test_config_1055.jsonp new file mode 100644 index 00000000..4bd33f3b --- /dev/null +++ b/test/testfiles/jpp-test_config_1055.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "name" : "C", + "testlist" : ["B", 2], + ${testlist.${testlist}}['${name}'] : 4 +} + diff --git a/test/testfiles/jpp-test_config_1056.jsonp b/test/testfiles/jpp-test_config_1056.jsonp new file mode 100644 index 00000000..f96893a0 --- /dev/null +++ b/test/testfiles/jpp-test_config_1056.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "testdict" : {"A" : 1}, + "name" : "C", + ${testdict.${name}}['${name}'] : 5 +} + diff --git a/test/testfiles/jpp-test_config_1057.jsonp b/test/testfiles/jpp-test_config_1057.jsonp new file mode 100644 index 00000000..00f03ef0 --- /dev/null +++ b/test/testfiles/jpp-test_config_1057.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + "testdict" : {"A" : 1}, + "name" : "C", + ${testdict}[${name}][${name}] : 4 +} + From e2929e34d4895199ead7a48784a225f4f9486d23 Mon Sep 17 00:00:00 2001 From: qth2hi Date: Tue, 9 Jan 2024 17:05:26 +0100 Subject: [PATCH 2/3] Added test cases JPP_0511, JPP_0551, JPP_0552, JPP_0553, JPP_1058, JPP_0268 --- test/JPP_TestUsecases.csv | 6 + test/JPP_TestUsecases.html | 312 ++++++++++++++---- test/JPP_TestUsecases.rst | 66 +++- test/JPP_TestUsecases.txt | 28 +- test/component_test.py | 2 +- .../test_04_PARAMETER_SUBSTITUTION_BADCASE.py | 10 +- .../test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py | 10 +- .../test_08_COMPOSITE_EXPRESSIONS_BADCASE.py | 26 +- .../test_12_IMPLICIT_CREATION_BADCASE.py | 10 +- test/testconfig/TestConfig.py | 87 +++++ test/testfiles/jpp-test_config_0268.jsonp | 19 ++ test/testfiles/jpp-test_config_0511.jsonp | 20 ++ test/testfiles/jpp-test_config_0551.jsonp | 19 ++ test/testfiles/jpp-test_config_0552.jsonp | 19 ++ test/testfiles/jpp-test_config_0553.jsonp | 19 ++ test/testfiles/jpp-test_config_1058.jsonp | 19 ++ 16 files changed, 609 insertions(+), 63 deletions(-) create mode 100644 test/testfiles/jpp-test_config_0268.jsonp create mode 100644 test/testfiles/jpp-test_config_0511.jsonp create mode 100644 test/testfiles/jpp-test_config_0551.jsonp create mode 100644 test/testfiles/jpp-test_config_0552.jsonp create mode 100644 test/testfiles/jpp-test_config_0553.jsonp create mode 100644 test/testfiles/jpp-test_config_1058.jsonp diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 544ffd9b..3172ed36 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -33,6 +33,7 @@ JPP_0264|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substituti JPP_0265|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2) JPP_0266|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1) JPP_0267|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2) +JPP_0268|PARAMETER_SUBSTITUTION|BADCASE|JSON file containing a list; list index is defined by a parameter and wrapped in single quotes JPP_0300|VALUE_DETECTION|GOODCASE|JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) JPP_0301|VALUE_DETECTION|GOODCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (valid syntax) JPP_0302|VALUE_DETECTION|GOODCASE|JSON file with expression starting with '${' and ending with '}' / no further matching '${' and '}' in between (valid syntax) @@ -69,7 +70,11 @@ JPP_0507|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string conc JPP_0508|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string concatenations in separate lines (2) JPP_0509|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (different syntax) JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (extended string concatenation) +JPP_0511|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a list; list index is defined by a parameter 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_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) @@ -86,6 +91,7 @@ JPP_1054|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data stru JPP_1055|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (5) JPP_1056|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (6) JPP_1057|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (7) +JPP_1058|IMPLICIT_CREATION|BADCASE|JSON file containing .... (invalid syntax) JPP_1150|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports itself) JPP_1151|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports another file, that is already imported) JPP_1200|PATH_FORMATS|GOODCASE|Relative path to JSON file diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index 2136df85..a8d3d2c5 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -1123,6 +1123,40 @@ 34
+ + + +JPP_0268 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file containing a list; list index is defined by a parameter and wrapped in single quotes
+Expected: No values are returned, and JsonPreprocessor throws an exception + +
+List indices must be of type 'int' +
+ + + + + + + +35 + + @@ -1154,7 +1188,7 @@ -35 +36 @@ -1188,7 +1222,7 @@ -36 +37 @@ -1222,7 +1256,7 @@ -37 +38 @@ -1256,7 +1290,7 @@ -38 +39 @@ -1290,7 +1324,7 @@ -39 +40 @@ -1324,7 +1358,7 @@ -40 +41 @@ -1358,7 +1392,7 @@ -41 +42 @@ -1392,7 +1426,7 @@ -42 +43 @@ -1426,7 +1460,7 @@ -43 +44 @@ -1460,7 +1494,7 @@ -44 +45 @@ -1494,7 +1528,7 @@ -45 +46 @@ -1528,7 +1562,7 @@ -46 +47 @@ -1562,7 +1596,7 @@ -47 +48 @@ -1596,7 +1630,7 @@ -48 +49 @@ -1630,7 +1664,7 @@ -49 +50 @@ -1664,7 +1698,7 @@ -50 +51 @@ -1698,7 +1732,7 @@ -51 +52 @@ -1732,7 +1766,7 @@ -52 +53 @@ -1766,7 +1800,7 @@ -53 +54 @@ -1800,7 +1834,7 @@ -54 +55 @@ -1834,7 +1868,7 @@ -55 +56 @@ -1868,7 +1902,7 @@ -56 +57 @@ -1902,7 +1936,7 @@ -57 +58 @@ -1936,7 +1970,7 @@ -58 +59 @@ -1970,7 +2004,7 @@ -59 +60 @@ -2004,7 +2038,7 @@ -60 +61 @@ -2038,7 +2072,7 @@ -61 +62 @@ -2072,7 +2106,7 @@ -62 +63 @@ -2106,7 +2140,7 @@ -63 +64 @@ -2139,7 +2173,7 @@ -64 +65 @@ -2172,7 +2206,7 @@ -65 +66 @@ -2205,7 +2239,7 @@ -66 +67 @@ -2238,7 +2272,7 @@ -67 +68 @@ -2271,7 +2305,7 @@ -68 +69 @@ -2304,7 +2338,7 @@ -69 +70 @@ -2337,7 +2371,40 @@ -70 +71 + + + + + +JPP_0511 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing a list; list index is defined by a parameter
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +72 @@ -2371,7 +2438,107 @@ -71 +73 + + + + + +JPP_0551 + + + + +COMPOSITE_EXPRESSIONS + + + + +BADCASE + + + + +JSON file containing a list; list index is defined by a parameter and wrapped in single quotes
+Expected: No values are returned, and JsonPreprocessor throws an exception + +
+List indices must be of type 'int' +
+ + + + + + + +74 + + + + + +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)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +75 + + + + + +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)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +76 @@ -2404,7 +2571,7 @@ -72 +77 @@ -2437,7 +2604,7 @@ -73 +78 @@ -2470,7 +2637,7 @@ -74 +79 @@ -2503,7 +2670,7 @@ -75 +80 @@ -2536,7 +2703,7 @@ -76 +81 @@ -2569,7 +2736,7 @@ -77 +82 @@ -2602,7 +2769,7 @@ -78 +83 @@ -2635,7 +2802,7 @@ -79 +84 @@ -2668,7 +2835,7 @@ -80 +85 @@ -2701,7 +2868,7 @@ -81 +86 @@ -2734,7 +2901,7 @@ -82 +87 @@ -2767,7 +2934,7 @@ -83 +88 @@ -2800,7 +2967,7 @@ -84 +89 @@ -2833,7 +3000,7 @@ -85 +90 @@ -2866,7 +3033,7 @@ -86 +91 @@ -2899,7 +3066,40 @@ -87 +92 + + + + + +JPP_1058 + + + + +IMPLICIT_CREATION + + + + +BADCASE + + + + +JSON file containing .... (invalid syntax)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +93 @@ -2932,7 +3132,7 @@ -88 +94 @@ -2965,7 +3165,7 @@ -89 +95 @@ -2999,7 +3199,7 @@
 

-
Generated: 09.01.2024 - 11:50:58
+
Generated: 09.01.2024 - 17:01:37
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index b37a5f13..ceab336a 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -345,6 +345,18 @@ Test Use Cases ---- +* **Test JPP_0268** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file containing a list; list index is defined by a parameter and wrapped in single quotes** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: List indices must be of type 'int'* + +---- + * **Test JPP_0300** [VALUE_DETECTION / GOODCASE] @@ -763,6 +775,16 @@ Test Use Cases ---- +* **Test JPP_0511** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing a list; list index is defined by a parameter** + + Expected: JsonPreprocessor returns expected value + +---- + * **Test JPP_0550** [COMPOSITE_EXPRESSIONS / BADCASE] @@ -775,6 +797,38 @@ Test Use Cases ---- +* **Test JPP_0551** + + [COMPOSITE_EXPRESSIONS / BADCASE] + + **JSON file containing a list; list index is defined by a parameter and wrapped in single quotes** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: List indices must be of type 'int'* + +---- + +* **Test 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)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test 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)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0600** [CODE_COMMENTS / GOODCASE] @@ -935,6 +989,16 @@ Test Use Cases ---- +* **Test JPP_1058** + + [IMPLICIT_CREATION / BADCASE] + + **JSON file containing .... (invalid syntax)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_1150** [CYCLIC_IMPORTS / BADCASE] @@ -967,5 +1031,5 @@ Test Use Cases ---- -Generated: 09.01.2024 - 11:50:58 +Generated: 09.01.2024 - 17:01:37 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index c06d4d07..986630ea 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -147,6 +147,11 @@ Test JPP_0267 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2) Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0268 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file containing a list; list index is defined by a parameter and wrapped in single quotes +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: List indices must be of type 'int' +------------------------------------------------------------------------------------------------------------------------ Test JPP_0300 / VALUE_DETECTION / GOODCASE Description: JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) Expectation: JsonPreprocessor returns values @@ -320,11 +325,28 @@ Test JPP_0510 / COMPOSITE_EXPRESSIONS / GOODCASE Description: JSON file containing several parameter assignments in separate lines (extended string concatenation) Expectation: JsonPreprocessor returns expected value ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0511 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing a list; list index is defined by a parameter +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 Hint.......: Dotdict notation (ambiguous in this case) ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0551 / COMPOSITE_EXPRESSIONS / BADCASE +Description: JSON file containing a list; list index is defined by a parameter and wrapped in single quotes +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: List indices must be of type 'int' +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0552 / COMPOSITE_EXPRESSIONS / BADCASE +Description: JSON file containing a list; list index 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_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_0600 / CODE_COMMENTS / GOODCASE Description: JSON file with several combinations of code comments Expectation: JsonPreprocessor returns remaining content of JSON file (valid parameters) @@ -389,6 +411,10 @@ Test JPP_1057 / IMPLICIT_CREATION / BADCASE Description: JSON file with implicit creation of data structures based on parameters (7) Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_1058 / IMPLICIT_CREATION / BADCASE +Description: JSON file containing .... (invalid syntax) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_1150 / CYCLIC_IMPORTS / BADCASE Description: JSON file with cyclic imports (JSON file imports itself) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -402,5 +428,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: 09.01.2024 - 11:50:58 +Generated: 09.01.2024 - 17:01:37 diff --git a/test/component_test.py b/test/component_test.py index 2af5d8b8..80b6e3db 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,7 +22,7 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.21.0" +VERSION = "0.22.0" VERSION_DATE = "09.01.2024" # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py index 279acb4b..e65c42db 100644 --- a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py +++ b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 20.11.2023 - 15:42:16 +# 09.01.2024 - 17:01:37 # # -------------------------------------------------------------------------------------------------------------- @@ -157,4 +157,12 @@ def test_JPP_0266(self, Description): def test_JPP_0267(self, Description): nReturn = CExecute.Execute("JPP_0267") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file containing a list; list index is defined by a parameter and wrapped in single quotes",] + ) + def test_JPP_0268(self, Description): + nReturn = CExecute.Execute("JPP_0268") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py index ebbf359d..f125caec 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 # -# 20.11.2023 - 15:42:16 +# 09.01.2024 - 17:01:37 # # -------------------------------------------------------------------------------------------------------------- @@ -109,4 +109,12 @@ def test_JPP_0509(self, Description): def test_JPP_0510(self, Description): nReturn = CExecute.Execute("JPP_0510") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing a list; list index is defined by a parameter",] + ) + def test_JPP_0511(self, Description): + nReturn = CExecute.Execute("JPP_0511") + 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 91d5a125..b2fb54e1 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 # -# 10.10.2023 - 13:31:11 +# 09.01.2024 - 17:01:37 # # -------------------------------------------------------------------------------------------------------------- @@ -37,4 +37,28 @@ class Test_COMPOSITE_EXPRESSIONS_BADCASE: def test_JPP_0550(self, Description): nReturn = CExecute.Execute("JPP_0550") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file containing a list; list index is defined by a parameter and wrapped in single quotes",] + ) + def test_JPP_0551(self, Description): + nReturn = CExecute.Execute("JPP_0551") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file containing a list; list index is defined by a parameter and placed inside the curly brackets (invalid syntax)",] + ) + def test_JPP_0552(self, Description): + nReturn = CExecute.Execute("JPP_0552") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "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)",] + ) + def test_JPP_0553(self, Description): + nReturn = CExecute.Execute("JPP_0553") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py b/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py index 68f98ff4..027c4a2c 100644 --- a/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py +++ b/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 09.01.2024 - 11:50:58 +# 09.01.2024 - 17:01:37 # # -------------------------------------------------------------------------------------------------------------- @@ -93,4 +93,12 @@ def test_JPP_1056(self, Description): def test_JPP_1057(self, Description): nReturn = CExecute.Execute("JPP_1057") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file containing .... (invalid syntax)",] + ) + def test_JPP_1058(self, Description): + nReturn = CExecute.Execute("JPP_1058") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index bad4926f..85908dda 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -1281,6 +1281,20 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0268" +dictUsecase['DESCRIPTION'] = "JSON file containing a list; list index is defined by a parameter and wrapped in single quotes" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "PARAMETER_SUBSTITUTION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = "List indices must be of type 'int'" +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0268.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "List indices must be of type 'int' (error message placeholder)" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_0300" @@ -1989,6 +2003,23 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0511" +dictUsecase['DESCRIPTION'] = "JSON file containing a list; list index is defined by a parameter" +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_0511.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (2/1) > {intval} [INT] : 1 +[DICT] (2/2) > {listval} [LIST] (2/1) > [STR] : 'B' +[DICT] (2/2) > {listval} [LIST] (2/2) > [INT] : 4""" +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_0550" @@ -2004,6 +2035,48 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0551" +dictUsecase['DESCRIPTION'] = "JSON file containing a list; list index is defined by a parameter and wrapped in single quotes" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = "List indices must be of type 'int'" +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0551.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "List indices must be of type 'int' (error message placeholder)" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0552" +dictUsecase['DESCRIPTION'] = "JSON file containing a list; list index is defined by a parameter and placed inside the curly brackets (invalid syntax)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0552.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0553" +dictUsecase['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)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0553.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_0600" @@ -2277,6 +2350,20 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1058" +dictUsecase['DESCRIPTION'] = "JSON file containing .... (invalid syntax)" +dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "BADCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1058.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" # currently: ''NoneType' object has no attribute 'group''! +dictUsecase['EXPECTEDRETURN'] = None +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_1150" diff --git a/test/testfiles/jpp-test_config_0268.jsonp b/test/testfiles/jpp-test_config_0268.jsonp new file mode 100644 index 00000000..93b678fc --- /dev/null +++ b/test/testfiles/jpp-test_config_0268.jsonp @@ -0,0 +1,19 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "intval" : 1, + "listval" : ["B", 2], + "param_${listval}['${intval}']}" : 3 +} \ No newline at end of file diff --git a/test/testfiles/jpp-test_config_0511.jsonp b/test/testfiles/jpp-test_config_0511.jsonp new file mode 100644 index 00000000..c34931ab --- /dev/null +++ b/test/testfiles/jpp-test_config_0511.jsonp @@ -0,0 +1,20 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "intval" : 1, + "listval" : ["B", 2], + ${listval}[${intval}] : 4 +} + diff --git a/test/testfiles/jpp-test_config_0551.jsonp b/test/testfiles/jpp-test_config_0551.jsonp new file mode 100644 index 00000000..96e59e59 --- /dev/null +++ b/test/testfiles/jpp-test_config_0551.jsonp @@ -0,0 +1,19 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "intval" : 1, + "listval" : ["B", 2], + ${listval}['${intval}'] : 4 +} diff --git a/test/testfiles/jpp-test_config_0552.jsonp b/test/testfiles/jpp-test_config_0552.jsonp new file mode 100644 index 00000000..ddbf0be6 --- /dev/null +++ b/test/testfiles/jpp-test_config_0552.jsonp @@ -0,0 +1,19 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "intval" : 1, + "listval" : ["B", 2], + ${listval[${intval}]} : 4 +} diff --git a/test/testfiles/jpp-test_config_0553.jsonp b/test/testfiles/jpp-test_config_0553.jsonp new file mode 100644 index 00000000..bf53e4b2 --- /dev/null +++ b/test/testfiles/jpp-test_config_0553.jsonp @@ -0,0 +1,19 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "intval" : 1, + "listval" : ["B", 2], + ${listval['${intval}']} : 4 +} diff --git a/test/testfiles/jpp-test_config_1058.jsonp b/test/testfiles/jpp-test_config_1058.jsonp new file mode 100644 index 00000000..49e1a75e --- /dev/null +++ b/test/testfiles/jpp-test_config_1058.jsonp @@ -0,0 +1,19 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "testdict" : {"A" : 1}, + "name" : "C", + ${testdict.${name}}['${name}'] : 5 +} From c55ea80aa4a0de7b3a180c70c0a206a8607ba0a3 Mon Sep 17 00:00:00 2001 From: qth2hi Date: Wed, 10 Jan 2024 12:36:39 +0100 Subject: [PATCH 3/3] Self test maintenance based on latest fixes in JsonPreprocessor Self test cases added (and commented out; to be invstigated later): JPP_0551, JPP_0552, JPP_0553, JPP_0268 --- test/JPP_TestUsecases.csv | 6 +- test/JPP_TestUsecases.html | 252 ++++-------------- test/JPP_TestUsecases.rst | 48 +--- test/JPP_TestUsecases.txt | 22 +- test/component_test.py | 2 +- .../test_04_PARAMETER_SUBSTITUTION_BADCASE.py | 10 +- .../test_08_COMPOSITE_EXPRESSIONS_BADCASE.py | 26 +- .../test_12_IMPLICIT_CREATION_BADCASE.py | 4 +- test/testconfig/TestConfig.py | 22 +- 9 files changed, 80 insertions(+), 312 deletions(-) diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 3172ed36..7cf077ad 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -33,7 +33,6 @@ JPP_0264|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substituti JPP_0265|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2) JPP_0266|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1) JPP_0267|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2) -JPP_0268|PARAMETER_SUBSTITUTION|BADCASE|JSON file containing a list; list index is defined by a parameter and wrapped in single quotes JPP_0300|VALUE_DETECTION|GOODCASE|JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) JPP_0301|VALUE_DETECTION|GOODCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (valid syntax) JPP_0302|VALUE_DETECTION|GOODCASE|JSON file with expression starting with '${' and ending with '}' / no further matching '${' and '}' in between (valid syntax) @@ -72,9 +71,6 @@ JPP_0509|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter a JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (extended string concatenation) JPP_0511|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a list; list index is defined by a parameter 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_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) @@ -91,7 +87,7 @@ JPP_1054|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data stru JPP_1055|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (5) JPP_1056|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (6) JPP_1057|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (7) -JPP_1058|IMPLICIT_CREATION|BADCASE|JSON file containing .... (invalid syntax) +JPP_1058|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (8) JPP_1150|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports itself) JPP_1151|CYCLIC_IMPORTS|BADCASE|JSON file with cyclic imports (JSON file imports another file, that is already imported) JPP_1200|PATH_FORMATS|GOODCASE|Relative path to JSON file diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index a8d3d2c5..e844199b 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -1123,40 +1123,6 @@ 34
- - - -JPP_0268 - - - - -PARAMETER_SUBSTITUTION - - - - -BADCASE - - - - -JSON file containing a list; list index is defined by a parameter and wrapped in single quotes
-Expected: No values are returned, and JsonPreprocessor throws an exception - -
-List indices must be of type 'int' -
- - - - - - - -35 - - @@ -1188,7 +1154,7 @@ -36 +35 @@ -1222,7 +1188,7 @@ -37 +36 @@ -1256,7 +1222,7 @@ -38 +37 @@ -1290,7 +1256,7 @@ -39 +38 @@ -1324,7 +1290,7 @@ -40 +39 @@ -1358,7 +1324,7 @@ -41 +40 @@ -1392,7 +1358,7 @@ -42 +41 @@ -1426,7 +1392,7 @@ -43 +42 @@ -1460,7 +1426,7 @@ -44 +43 @@ -1494,7 +1460,7 @@ -45 +44 @@ -1528,7 +1494,7 @@ -46 +45 @@ -1562,7 +1528,7 @@ -47 +46 @@ -1596,7 +1562,7 @@ -48 +47 @@ -1630,7 +1596,7 @@ -49 +48 @@ -1664,7 +1630,7 @@ -50 +49 @@ -1698,7 +1664,7 @@ -51 +50 @@ -1732,7 +1698,7 @@ -52 +51 @@ -1766,7 +1732,7 @@ -53 +52 @@ -1800,7 +1766,7 @@ -54 +53 @@ -1834,7 +1800,7 @@ -55 +54 @@ -1868,7 +1834,7 @@ -56 +55 @@ -1902,7 +1868,7 @@ -57 +56 @@ -1936,7 +1902,7 @@ -58 +57 @@ -1970,7 +1936,7 @@ -59 +58 @@ -2004,7 +1970,7 @@ -60 +59 @@ -2038,7 +2004,7 @@ -61 +60 @@ -2072,7 +2038,7 @@ -62 +61 @@ -2106,7 +2072,7 @@ -63 +62 @@ -2140,7 +2106,7 @@ -64 +63 @@ -2173,7 +2139,7 @@ -65 +64 @@ -2206,7 +2172,7 @@ -66 +65 @@ -2239,7 +2205,7 @@ -67 +66 @@ -2272,7 +2238,7 @@ -68 +67 @@ -2305,7 +2271,7 @@ -69 +68 @@ -2338,7 +2304,7 @@ -70 +69 @@ -2371,7 +2337,7 @@ -71 +70 @@ -2404,7 +2370,7 @@ -72 +71 @@ -2438,107 +2404,7 @@ -73 - - - - - -JPP_0551 - - - - -COMPOSITE_EXPRESSIONS - - - - -BADCASE - - - - -JSON file containing a list; list index is defined by a parameter and wrapped in single quotes
-Expected: No values are returned, and JsonPreprocessor throws an exception - -
-List indices must be of type 'int' -
- - - - - - - -74 - - - - - -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)
-Expected: No values are returned, and JsonPreprocessor throws an exception - - -
- - - - - - - -75 - - - - - -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)
-Expected: No values are returned, and JsonPreprocessor throws an exception - - -
- - - - - - - -76 +72 @@ -2571,7 +2437,7 @@ -77 +73 @@ -2604,7 +2470,7 @@ -78 +74 @@ -2637,7 +2503,7 @@ -79 +75 @@ -2670,7 +2536,7 @@ -80 +76 @@ -2703,7 +2569,7 @@ -81 +77 @@ -2736,7 +2602,7 @@ -82 +78 @@ -2769,7 +2635,7 @@ -83 +79 @@ -2802,7 +2668,7 @@ -84 +80 @@ -2835,7 +2701,7 @@ -85 +81 @@ -2868,7 +2734,7 @@ -86 +82 @@ -2901,7 +2767,7 @@ -87 +83 @@ -2934,7 +2800,7 @@ -88 +84 @@ -2967,7 +2833,7 @@ -89 +85 @@ -3000,7 +2866,7 @@ -90 +86 @@ -3033,7 +2899,7 @@ -91 +87 @@ -3066,7 +2932,7 @@ -92 +88 @@ -3087,7 +2953,7 @@ -JSON file containing .... (invalid syntax)
+JSON file with implicit creation of data structures based on parameters (8)
Expected: No values are returned, and JsonPreprocessor throws an exception @@ -3099,7 +2965,7 @@ -93 +89 @@ -3132,7 +2998,7 @@ -94 +90 @@ -3165,7 +3031,7 @@ -95 +91 @@ -3199,7 +3065,7 @@
 

-
Generated: 09.01.2024 - 17:01:37
+
Generated: 10.01.2024 - 12:25:22
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index ceab336a..90d36826 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -345,18 +345,6 @@ Test Use Cases ---- -* **Test JPP_0268** - - [PARAMETER_SUBSTITUTION / BADCASE] - - **JSON file containing a list; list index is defined by a parameter and wrapped in single quotes** - - Expected: No values are returned, and JsonPreprocessor throws an exception - - *Hint: List indices must be of type 'int'* - ----- - * **Test JPP_0300** [VALUE_DETECTION / GOODCASE] @@ -797,38 +785,6 @@ Test Use Cases ---- -* **Test JPP_0551** - - [COMPOSITE_EXPRESSIONS / BADCASE] - - **JSON file containing a list; list index is defined by a parameter and wrapped in single quotes** - - Expected: No values are returned, and JsonPreprocessor throws an exception - - *Hint: List indices must be of type 'int'* - ----- - -* **Test 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)** - - Expected: No values are returned, and JsonPreprocessor throws an exception - ----- - -* **Test 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)** - - Expected: No values are returned, and JsonPreprocessor throws an exception - ----- - * **Test JPP_0600** [CODE_COMMENTS / GOODCASE] @@ -993,7 +949,7 @@ Test Use Cases [IMPLICIT_CREATION / BADCASE] - **JSON file containing .... (invalid syntax)** + **JSON file with implicit creation of data structures based on parameters (8)** Expected: No values are returned, and JsonPreprocessor throws an exception @@ -1031,5 +987,5 @@ Test Use Cases ---- -Generated: 09.01.2024 - 17:01:37 +Generated: 10.01.2024 - 12:25:22 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index 986630ea..b6015cb1 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -147,11 +147,6 @@ Test JPP_0267 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2) Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ -Test JPP_0268 / PARAMETER_SUBSTITUTION / BADCASE -Description: JSON file containing a list; list index is defined by a parameter and wrapped in single quotes -Expectation: No values are returned, and JsonPreprocessor throws an exception -Hint.......: List indices must be of type 'int' ------------------------------------------------------------------------------------------------------------------------- Test JPP_0300 / VALUE_DETECTION / GOODCASE Description: JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) Expectation: JsonPreprocessor returns values @@ -334,19 +329,6 @@ Description: JSON file with composite data structure (nested lists and dictionar Expectation: No values are returned, and JsonPreprocessor throws an exception Hint.......: Dotdict notation (ambiguous in this case) ------------------------------------------------------------------------------------------------------------------------ -Test JPP_0551 / COMPOSITE_EXPRESSIONS / BADCASE -Description: JSON file containing a list; list index is defined by a parameter and wrapped in single quotes -Expectation: No values are returned, and JsonPreprocessor throws an exception -Hint.......: List indices must be of type 'int' ------------------------------------------------------------------------------------------------------------------------- -Test JPP_0552 / COMPOSITE_EXPRESSIONS / BADCASE -Description: JSON file containing a list; list index 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_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_0600 / CODE_COMMENTS / GOODCASE Description: JSON file with several combinations of code comments Expectation: JsonPreprocessor returns remaining content of JSON file (valid parameters) @@ -412,7 +394,7 @@ Description: JSON file with implicit creation of data structures based on parame Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ Test JPP_1058 / IMPLICIT_CREATION / BADCASE -Description: JSON file containing .... (invalid syntax) +Description: JSON file with implicit creation of data structures based on parameters (8) Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ Test JPP_1150 / CYCLIC_IMPORTS / BADCASE @@ -428,5 +410,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: 09.01.2024 - 17:01:37 +Generated: 10.01.2024 - 12:25:22 diff --git a/test/component_test.py b/test/component_test.py index 80b6e3db..634c513e 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -23,7 +23,7 @@ # -------------------------------------------------------------------------------------------------------------- # VERSION = "0.22.0" -VERSION_DATE = "09.01.2024" +VERSION_DATE = "10.01.2024" # # -------------------------------------------------------------------------------------------------------------- #TM*** diff --git a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py index e65c42db..7957f35a 100644 --- a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py +++ b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 09.01.2024 - 17:01:37 +# 10.01.2024 - 12:25:22 # # -------------------------------------------------------------------------------------------------------------- @@ -157,12 +157,4 @@ def test_JPP_0266(self, Description): def test_JPP_0267(self, Description): nReturn = CExecute.Execute("JPP_0267") assert nReturn == 0 -# -------------------------------------------------------------------------------------------------------------- - # Expected: No values are returned, and JsonPreprocessor throws an exception - @pytest.mark.parametrize( - "Description", ["JSON file containing a list; list index is defined by a parameter and wrapped in single quotes",] - ) - def test_JPP_0268(self, Description): - nReturn = CExecute.Execute("JPP_0268") - 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 b2fb54e1..d5da154a 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 # -# 09.01.2024 - 17:01:37 +# 10.01.2024 - 12:25:22 # # -------------------------------------------------------------------------------------------------------------- @@ -37,28 +37,4 @@ class Test_COMPOSITE_EXPRESSIONS_BADCASE: def test_JPP_0550(self, Description): nReturn = CExecute.Execute("JPP_0550") assert nReturn == 0 -# -------------------------------------------------------------------------------------------------------------- - # Expected: No values are returned, and JsonPreprocessor throws an exception - @pytest.mark.parametrize( - "Description", ["JSON file containing a list; list index is defined by a parameter and wrapped in single quotes",] - ) - def test_JPP_0551(self, Description): - nReturn = CExecute.Execute("JPP_0551") - assert nReturn == 0 -# -------------------------------------------------------------------------------------------------------------- - # Expected: No values are returned, and JsonPreprocessor throws an exception - @pytest.mark.parametrize( - "Description", ["JSON file containing a list; list index is defined by a parameter and placed inside the curly brackets (invalid syntax)",] - ) - def test_JPP_0552(self, Description): - nReturn = CExecute.Execute("JPP_0552") - assert nReturn == 0 -# -------------------------------------------------------------------------------------------------------------- - # Expected: No values are returned, and JsonPreprocessor throws an exception - @pytest.mark.parametrize( - "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)",] - ) - def test_JPP_0553(self, Description): - nReturn = CExecute.Execute("JPP_0553") - assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py b/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py index 027c4a2c..2bf499e9 100644 --- a/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py +++ b/test/pytest/pytestfiles/test_12_IMPLICIT_CREATION_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 09.01.2024 - 17:01:37 +# 10.01.2024 - 12:25:22 # # -------------------------------------------------------------------------------------------------------------- @@ -96,7 +96,7 @@ def test_JPP_1057(self, Description): # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( - "Description", ["JSON file containing .... (invalid syntax)",] + "Description", ["JSON file with implicit creation of data structures based on parameters (8)",] ) def test_JPP_1058(self, Description): nReturn = CExecute.Execute("JPP_1058") diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index eaad5f36..8478a876 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -1292,7 +1292,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0268.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "List indices must be of type 'int' (error message placeholder)" dictUsecase['EXPECTEDRETURN'] = None -listofdictUsecases.append(dictUsecase) +# # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -2046,7 +2046,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0551.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "List indices must be of type 'int' (error message placeholder)" dictUsecase['EXPECTEDRETURN'] = None -listofdictUsecases.append(dictUsecase) +# # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -2060,7 +2060,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0552.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None -listofdictUsecases.append(dictUsecase) +# # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -2074,7 +2074,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0553.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None -listofdictUsecases.append(dictUsecase) +# # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -2289,7 +2289,7 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1053.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = None # test case currently causes a crash of the JsonPreprocessor; 'EXPECTEDEXCEPTION' needs to be defined after bug is fixed +dictUsecase['EXPECTEDEXCEPTION'] = "Only simple data types are allowed to be substituted inside" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -2303,7 +2303,7 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1054.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = None # test case currently causes a crash of the JsonPreprocessor; 'EXPECTEDEXCEPTION' needs to be defined after bug is fixed +dictUsecase['EXPECTEDEXCEPTION'] = "Only simple data types are allowed to be substituted inside" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -2317,7 +2317,7 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1055.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = None # test case currently causes a crash of the JsonPreprocessor; 'EXPECTEDEXCEPTION' needs to be defined after bug is fixed +dictUsecase['EXPECTEDEXCEPTION'] = "Only simple data types are allowed to be substituted inside" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -2331,7 +2331,7 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1056.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" # currently causes : ''NoneType' object has no attribute 'group''! +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -2345,21 +2345,21 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1057.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" # currently values are returned with unresolved dollar operator expressions +dictUsecase['EXPECTEDEXCEPTION'] = "Could not set variable 'testdict[C][C]' with value '4'! Reason: name 'C' is not defined" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_1058" -dictUsecase['DESCRIPTION'] = "JSON file containing .... (invalid syntax)" +dictUsecase['DESCRIPTION'] = "JSON file with implicit creation of data structures based on parameters (8)" dictUsecase['EXPECTATION'] = "No values are returned, and JsonPreprocessor throws an exception" dictUsecase['SECTION'] = "IMPLICIT_CREATION" dictUsecase['SUBSECTION'] = "BADCASE" dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1058.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" # currently: ''NoneType' object has no attribute 'group''! +dictUsecase['EXPECTEDEXCEPTION'] = "The implicit creation of data structures based on nested parameter is not supported" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase