From aefa62a85a229b2107e3e8b3ac48a3cc16a82e19 Mon Sep 17 00:00:00 2001 From: qth2hi Date: Wed, 9 Aug 2023 11:49:25 +0200 Subject: [PATCH] Reactivated JPP_0251, JPP_0253, JPP_0257, JPP_0300, JPP_0500, JPP_0502, JPP_0506 --- test/JPP_TestUsecases.csv | 8 + test/JPP_TestUsecases.html | 297 +++++++++++++++++- test/JPP_TestUsecases.rst | 88 +++++- test/JPP_TestUsecases.txt | 37 ++- test/component_test.py | 2 +- .../test_01_DATA_TYPES_GOODCASE.py | 10 +- .../test_02_DATA_INTEGRITY_GOODCASE.py | 2 +- ...test_03_PARAMETER_SUBSTITUTION_GOODCASE.py | 2 +- .../test_04_PARAMETER_SUBSTITUTION_BADCASE.py | 26 +- .../test_05_VALUE_DETECTION_GOODCASE.py | 40 +++ ....py => test_06_VALUE_DETECTION_BADCASE.py} | 4 +- .../test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py | 56 ++++ ...t_08_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py} | 4 +- ...st_09_COMMON_SYNTAX_VIOLATIONS_BADCASE.py} | 4 +- test/testconfig/TestConfig.py | 14 +- 15 files changed, 559 insertions(+), 35 deletions(-) create mode 100644 test/pytest/pytestfiles/test_05_VALUE_DETECTION_GOODCASE.py rename test/pytest/pytestfiles/{test_05_VALUE_DETECTION_BADCASE.py => test_06_VALUE_DETECTION_BADCASE.py} (96%) create mode 100644 test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py rename test/pytest/pytestfiles/{test_06_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py => test_08_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py} (96%) rename test/pytest/pytestfiles/{test_07_COMMON_SYNTAX_VIOLATIONS_BADCASE.py => test_09_COMMON_SYNTAX_VIOLATIONS_BADCASE.py} (97%) diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 0c36f38c..ceeb504c 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -2,15 +2,23 @@ sep=| TESTID|SECTION|SUBSECTION|DESCRIPTION JPP_0001|DATA_TYPES|GOODCASE|JSON file with parameters of different data types (basic and composite) JPP_0002|DATA_TYPES|GOODCASE|JSON file containing parameters with dollar operator syntax at right hand side of colon, basic data types +JPP_0003|DATA_TYPES|GOODCASE|JSON file containing parameters with dollar operator syntax at right hand side of colon, composite data type: list JPP_0100|DATA_INTEGRITY|GOODCASE|JSON file is empty (single pair of brackets only) JPP_0101|DATA_INTEGRITY|GOODCASE|JSON file with string containing several separator characters and blanks; no parameters JPP_0102|DATA_INTEGRITY|GOODCASE|JSON file with string containing more special characters, masked special characters and escape sequences JPP_0200|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / string parameter substitution in parameter value JPP_0201|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / string parameter substitution in parameter name JPP_0250|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / string parameter substitution in parameter value / innermost parameter not existing +JPP_0251|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / string parameter substitution in parameter name / in between parameter not existing +JPP_0253|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing JPP_0255|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation / index parameter not existing +JPP_0257|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing JPP_0259|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation / milestone number not existing +JPP_0300|VALUE_DETECTION|GOODCASE|JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) JPP_0361|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 1) +JPP_0500|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 1) +JPP_0502|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside) +JPP_0506|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite strings containing several combinations of curly brackets and special characters before JPP_0900|COMMON_SYNTAX_VIOLATIONS|GOODCASE|JSON file with syntax error, that is commented out JPP_0950|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (1) JPP_0951|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (2) diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index 8f3e3d1f..89bae9ae 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -100,6 +100,39 @@ 3 + + + +JPP_0003 + + + + +DATA_TYPES + + + + +GOODCASE + + + + +JSON file containing parameters with dollar operator syntax at right hand side of colon, composite data type: list
+Expected: All parameters referenced by dollar operator are resolved correctly, with their correct data types + + +
+ + + + + + + +4 + + @@ -130,7 +163,7 @@ -4 +5 @@ -163,7 +196,7 @@ -5 +6 @@ -196,7 +229,7 @@ -6 +7 @@ -229,7 +262,7 @@ -7 +8 @@ -262,7 +295,7 @@ -8 +9 @@ -295,7 +328,73 @@ -9 +10 + + + + + +JPP_0251 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / string parameter substitution in parameter name / in between parameter not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +11 + + + + + +JPP_0253 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +12 @@ -328,7 +427,40 @@ -10 +13 + + + + + +JPP_0257 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +14 @@ -361,7 +493,41 @@ -11 +15 + + + + + +JPP_0300 + + + + +VALUE_DETECTION + + + + +GOODCASE + + + + +JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax)
+Expected: JsonPreprocessor returns values + +
+Checklist rule 1 +
+ + + + + + + +16 @@ -395,7 +561,108 @@ -12 +17 + + + + + +JPP_0500 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file with composite data structure (nested lists and dictionaries 1)
+Expected: JsonPreprocessor returns expected value + +
+Standard notation +
+ + + + + + + +18 + + + + + +JPP_0502 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside)
+Expected: JsonPreprocessor returns expected value + +
+Standard notation +
+ + + + + + + +19 + + + + + +JPP_0506 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file with composite strings containing several combinations of curly brackets and special characters before
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +20 @@ -428,7 +695,7 @@ -13 +21 @@ -461,7 +728,7 @@ -14 +22 @@ -494,7 +761,7 @@ -15 +23 @@ -527,7 +794,7 @@ -16 +24 @@ -560,7 +827,7 @@ -17 +25 @@ -593,7 +860,7 @@
 

-
Generated: 08.08.2023 - 15:09:12
+
Generated: 09.08.2023 - 11:47:23
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index 86a3ca50..75bbe18f 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -35,6 +35,16 @@ Test Use Cases ---- +* **Test JPP_0003** + + [DATA_TYPES / GOODCASE] + + **JSON file containing parameters with dollar operator syntax at right hand side of colon, composite data type: list** + + Expected: All parameters referenced by dollar operator are resolved correctly, with their correct data types + +---- + * **Test JPP_0100** [DATA_INTEGRITY / GOODCASE] @@ -95,6 +105,26 @@ Test Use Cases ---- +* **Test JPP_0251** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with nested parameter / string parameter substitution in parameter name / in between parameter not existing** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0253** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0255** [PARAMETER_SUBSTITUTION / BADCASE] @@ -105,6 +135,16 @@ Test Use Cases ---- +* **Test JPP_0257** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0259** [PARAMETER_SUBSTITUTION / BADCASE] @@ -115,6 +155,18 @@ Test Use Cases ---- +* **Test JPP_0300** + + [VALUE_DETECTION / GOODCASE] + + **JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax)** + + Expected: JsonPreprocessor returns values + + *Hint: Checklist rule 1* + +---- + * **Test JPP_0361** [VALUE_DETECTION / BADCASE] @@ -127,6 +179,40 @@ Test Use Cases ---- +* **Test JPP_0500** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file with composite data structure (nested lists and dictionaries 1)** + + Expected: JsonPreprocessor returns expected value + + *Hint: Standard notation* + +---- + +* **Test JPP_0502** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside)** + + Expected: JsonPreprocessor returns expected value + + *Hint: Standard notation* + +---- + +* **Test JPP_0506** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file with composite strings containing several combinations of curly brackets and special characters before** + + Expected: JsonPreprocessor returns expected value + +---- + * **Test JPP_0900** [COMMON_SYNTAX_VIOLATIONS / GOODCASE] @@ -187,5 +273,5 @@ Test Use Cases ---- -Generated: 08.08.2023 - 15:09:12 +Generated: 09.08.2023 - 11:47:23 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index aa07aceb..0ede77ee 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -23,6 +23,10 @@ Test JPP_0002 / DATA_TYPES / GOODCASE Description: JSON file containing parameters with dollar operator syntax at right hand side of colon, basic data types Expectation: All parameters referenced by dollar operator are resolved correctly, with their correct data types ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0003 / DATA_TYPES / GOODCASE +Description: JSON file containing parameters with dollar operator syntax at right hand side of colon, composite data type: list +Expectation: All parameters referenced by dollar operator are resolved correctly, with their correct data types +------------------------------------------------------------------------------------------------------------------------ Test JPP_0100 / DATA_INTEGRITY / GOODCASE Description: JSON file is empty (single pair of brackets only) Expectation: JsonPreprocessor returns empty dictionary @@ -47,19 +51,50 @@ Test JPP_0250 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / string parameter substitution in parameter value / innermost parameter not existing Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0251 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with nested parameter / string parameter substitution in parameter name / in between parameter not existing +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0253 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_0255 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation / index parameter not existing Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0257 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_0259 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation / milestone number not existing Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +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 +Hint.......: Checklist rule 1 +------------------------------------------------------------------------------------------------------------------------ Test JPP_0361 / VALUE_DETECTION / BADCASE Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 1) Expectation: No values are returned, and JsonPreprocessor throws an exception Hint.......: Checklist rule 3 / pattern 1 ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0500 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file with composite data structure (nested lists and dictionaries 1) +Expectation: JsonPreprocessor returns expected value +Hint.......: Standard notation +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0502 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside) +Expectation: JsonPreprocessor returns expected value +Hint.......: Standard notation +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0506 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file with composite strings containing several combinations of curly brackets and special characters before +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ Test JPP_0900 / COMMON_SYNTAX_VIOLATIONS / GOODCASE Description: JSON file with syntax error, that is commented out Expectation: JsonPreprocessor returns remaining content of JSON file (valid parameters) @@ -84,5 +119,5 @@ Test JPP_0954 / COMMON_SYNTAX_VIOLATIONS / BADCASE Description: JSON file with syntax error (5): file is empty (multiple pairs of brackets only) Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ -Generated: 08.08.2023 - 15:09:12 +Generated: 09.08.2023 - 11:47:23 diff --git a/test/component_test.py b/test/component_test.py index cfcbb4c2..65aeb28a 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,7 +22,7 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.4.0" +VERSION = "0.5.0" VERSION_DATE = "09.08.2023" # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_01_DATA_TYPES_GOODCASE.py b/test/pytest/pytestfiles/test_01_DATA_TYPES_GOODCASE.py index 4b4c059f..dc79b7f6 100644 --- a/test/pytest/pytestfiles/test_01_DATA_TYPES_GOODCASE.py +++ b/test/pytest/pytestfiles/test_01_DATA_TYPES_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- @@ -45,4 +45,12 @@ def test_JPP_0001(self, Description): def test_JPP_0002(self, Description): nReturn = CExecute.Execute("JPP_0002") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: All parameters referenced by dollar operator are resolved correctly, with their correct data types + @pytest.mark.parametrize( + "Description", ["JSON file containing parameters with dollar operator syntax at right hand side of colon, composite data type: list",] + ) + def test_JPP_0003(self, Description): + nReturn = CExecute.Execute("JPP_0003") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_02_DATA_INTEGRITY_GOODCASE.py b/test/pytest/pytestfiles/test_02_DATA_INTEGRITY_GOODCASE.py index f509ac6d..c1bba20e 100644 --- a/test/pytest/pytestfiles/test_02_DATA_INTEGRITY_GOODCASE.py +++ b/test/pytest/pytestfiles/test_02_DATA_INTEGRITY_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py b/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py index 04f34559..7b14f10e 100644 --- a/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py +++ b/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py index 3b4680d9..11ce7b41 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 # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- @@ -37,6 +37,22 @@ class Test_PARAMETER_SUBSTITUTION_BADCASE: def test_JPP_0250(self, Description): nReturn = CExecute.Execute("JPP_0250") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / string parameter substitution in parameter name / in between parameter not existing",] + ) + def test_JPP_0251(self, Description): + nReturn = CExecute.Execute("JPP_0251") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing",] + ) + def test_JPP_0253(self, Description): + nReturn = CExecute.Execute("JPP_0253") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( @@ -45,6 +61,14 @@ def test_JPP_0250(self, Description): def test_JPP_0255(self, Description): nReturn = CExecute.Execute("JPP_0255") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing",] + ) + def test_JPP_0257(self, Description): + nReturn = CExecute.Execute("JPP_0257") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( diff --git a/test/pytest/pytestfiles/test_05_VALUE_DETECTION_GOODCASE.py b/test/pytest/pytestfiles/test_05_VALUE_DETECTION_GOODCASE.py new file mode 100644 index 00000000..ca126b6c --- /dev/null +++ b/test/pytest/pytestfiles/test_05_VALUE_DETECTION_GOODCASE.py @@ -0,0 +1,40 @@ +# ************************************************************************************************************** +# 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_05_VALUE_DETECTION_GOODCASE.py +# +# XC-CT/ECA3-Queckenstedt +# +# 09.08.2023 - 11:47:23 +# +# -------------------------------------------------------------------------------------------------------------- + +import pytest +from pytestlibs.CExecute import CExecute + +# -------------------------------------------------------------------------------------------------------------- + +class Test_VALUE_DETECTION_GOODCASE: + +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns values + @pytest.mark.parametrize( + "Description", ["JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax)",] + ) + def test_JPP_0300(self, Description): + nReturn = CExecute.Execute("JPP_0300") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_05_VALUE_DETECTION_BADCASE.py b/test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py similarity index 96% rename from test/pytest/pytestfiles/test_05_VALUE_DETECTION_BADCASE.py rename to test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py index 25fa049a..dd7f77c4 100644 --- a/test/pytest/pytestfiles/test_05_VALUE_DETECTION_BADCASE.py +++ b/test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py @@ -14,11 +14,11 @@ # limitations under the License. # -------------------------------------------------------------------------------------------------------------- # -# test_05_VALUE_DETECTION_BADCASE.py +# test_06_VALUE_DETECTION_BADCASE.py # # XC-CT/ECA3-Queckenstedt # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py new file mode 100644 index 00000000..ecab0ff4 --- /dev/null +++ b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py @@ -0,0 +1,56 @@ +# ************************************************************************************************************** +# 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_07_COMPOSITE_EXPRESSIONS_GOODCASE.py +# +# XC-CT/ECA3-Queckenstedt +# +# 09.08.2023 - 11:47:23 +# +# -------------------------------------------------------------------------------------------------------------- + +import pytest +from pytestlibs.CExecute import CExecute + +# -------------------------------------------------------------------------------------------------------------- + +class Test_COMPOSITE_EXPRESSIONS_GOODCASE: + +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file with composite data structure (nested lists and dictionaries 1)",] + ) + def test_JPP_0500(self, Description): + nReturn = CExecute.Execute("JPP_0500") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside)",] + ) + def test_JPP_0502(self, Description): + nReturn = CExecute.Execute("JPP_0502") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file with composite strings containing several combinations of curly brackets and special characters before",] + ) + def test_JPP_0506(self, Description): + nReturn = CExecute.Execute("JPP_0506") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_06_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py b/test/pytest/pytestfiles/test_08_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py similarity index 96% rename from test/pytest/pytestfiles/test_06_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py rename to test/pytest/pytestfiles/test_08_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py index 304a502e..55b1d2df 100644 --- a/test/pytest/pytestfiles/test_06_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_08_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py @@ -14,11 +14,11 @@ # limitations under the License. # -------------------------------------------------------------------------------------------------------------- # -# test_06_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py +# test_08_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py # # XC-CT/ECA3-Queckenstedt # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_07_COMMON_SYNTAX_VIOLATIONS_BADCASE.py b/test/pytest/pytestfiles/test_09_COMMON_SYNTAX_VIOLATIONS_BADCASE.py similarity index 97% rename from test/pytest/pytestfiles/test_07_COMMON_SYNTAX_VIOLATIONS_BADCASE.py rename to test/pytest/pytestfiles/test_09_COMMON_SYNTAX_VIOLATIONS_BADCASE.py index 1b141c16..bc6c6241 100644 --- a/test/pytest/pytestfiles/test_07_COMMON_SYNTAX_VIOLATIONS_BADCASE.py +++ b/test/pytest/pytestfiles/test_09_COMMON_SYNTAX_VIOLATIONS_BADCASE.py @@ -14,11 +14,11 @@ # limitations under the License. # -------------------------------------------------------------------------------------------------------------- # -# test_07_COMMON_SYNTAX_VIOLATIONS_BADCASE.py +# test_09_COMMON_SYNTAX_VIOLATIONS_BADCASE.py # # XC-CT/ECA3-Queckenstedt # -# 08.08.2023 - 15:09:12 +# 09.08.2023 - 11:47:23 # # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index 521221b3..4077c0fd 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -993,7 +993,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0251.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "The variable '${IAMNOTEXISTING}' is not available!" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1021,7 +1021,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0253.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "The variable '${IAMNOTEXISTING}' is not available!" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1077,7 +1077,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0257.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "The variable '${IAMNOTEXISTING}' is not available!" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1239,7 +1239,7 @@ [DICT] (4/3) > {val2} [STR] : '3.4' [DICT] (4/4) > {val3} [STR] : 'value_56' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1692,7 +1692,7 @@ [DICT] (2/1) > {params} [LIST] (2/2) > [DICT] (2/2) > {dict_2_key_2} [DICT] (2/2) > {dict_2_A_key_2} [LIST] (3/3) > [DICT] (2/2) > {dict_2_A_key_2_subkey_2} [LIST] (2/2) > [STR] : 'value_2' [DICT] (2/2) > {param} [STR] : 'value_2' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1744,7 +1744,7 @@ [DICT] (2/1) > {params} [LIST] (2/2) > [DICT] (2/2) > {dict_2_key_2} [DICT] (2/2) > {dict.2.A.key.2} [LIST] (3/3) > [DICT] (2/2) > {dict_2_A_key_2_subkey_2} [LIST] (2/2) > [STR] : 'value_2' [DICT] (2/2) > {param} [STR] : 'value_2' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1857,7 +1857,7 @@ [DICT] (12/11) > {var8} [STR] : 'value 8 > @{param2}' [DICT] (12/12) > {var9} [STR] : 'value 9 > @{param3}' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------------------------------