Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/JPP_TestUsecases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ JPP_0506|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite strings contain
JPP_0507|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string concatenations in separate lines (1)
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_0550|COMPOSITE_EXPRESSIONS|BADCASE|JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside)
JPP_0900|COMMON_SYNTAX_VIOLATIONS|GOODCASE|JSON file with syntax error, that is commented out
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)
JPP_0952|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (3)
Expand Down
63 changes: 48 additions & 15 deletions test/JPP_TestUsecases.html
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,39 @@
51
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
<font size="2" face="Arial" color="#595959">
<b>
<a target="_blank" href="https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_0510.jsonp">JPP_0510</a>
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
<font size="2" face="Arial" color="#4169E1">
COMPOSITE_EXPRESSIONS
</font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
<font size="2" face="Arial" color="#008000">
GOODCASE
</font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="left">
<font size="2" face="Arial" color="#595959"><i>
<b>JSON file containing several parameter assignments in separate lines (extended string concatenation)</b><br>
Expected: JsonPreprocessor returns expected value


</i></font></td>


</tr>
<tr valign="middle" align="left">
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
52
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
<font size="2" face="Arial" color="#595959">
<b>
Expand Down Expand Up @@ -1738,18 +1771,18 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
52
53
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
<font size="2" face="Arial" color="#595959">
<b>
<a target="_blank" href="https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_0900.jsonp">JPP_0900</a>
<a target="_blank" href="https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_0600.jsonp">JPP_0600</a>
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
<font size="2" face="Arial" color="#4169E1">
COMMON_SYNTAX_VIOLATIONS
CODE_COMMENTS
</font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand All @@ -1759,7 +1792,7 @@

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="left">
<font size="2" face="Arial" color="#595959"><i>
<b>JSON file with syntax error, that is commented out</b><br>
<b>JSON file with several combinations of code comments</b><br>
Expected: JsonPreprocessor returns remaining content of JSON file (valid parameters)


Expand All @@ -1771,7 +1804,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
53
54
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -1804,7 +1837,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
54
55
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -1837,7 +1870,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
55
56
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -1870,7 +1903,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
56
57
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -1903,7 +1936,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
57
58
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -1936,7 +1969,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
58
59
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -1969,7 +2002,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
59
60
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -2002,7 +2035,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
60
61
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -2035,7 +2068,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
61
62
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -2068,7 +2101,7 @@
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
<font size="2" face="Arial" color="#FF0000">
<b>
62
63
</b></font></td>

<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
Expand Down Expand Up @@ -2102,7 +2135,7 @@
</tbody></table></div>
<div>&nbsp;</div>
<hr width="100%" color="#FF8C00" align="center">
<div align="center"><font size="2" color="#27408B">Generated: 10.10.2023 - 13:31:11</font></div>
<div align="center"><font size="2" color="#27408B">Generated: 18.10.2023 - 17:37:45</font></div>
<div>&nbsp;</div>
</body></html>

18 changes: 14 additions & 4 deletions test/JPP_TestUsecases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,16 @@ Test Use Cases

----

* **Test JPP_0510**

[COMPOSITE_EXPRESSIONS / GOODCASE]

**JSON file containing several parameter assignments in separate lines (extended string concatenation)**

Expected: JsonPreprocessor returns expected value

----

* **Test JPP_0550**

[COMPOSITE_EXPRESSIONS / BADCASE]
Expand All @@ -573,11 +583,11 @@ Test Use Cases

----

* **Test JPP_0900**
* **Test JPP_0600**

[COMMON_SYNTAX_VIOLATIONS / GOODCASE]
[CODE_COMMENTS / GOODCASE]

**JSON file with syntax error, that is commented out**
**JSON file with several combinations of code comments**

Expected: JsonPreprocessor returns remaining content of JSON file (valid parameters)

Expand Down Expand Up @@ -685,5 +695,5 @@ Test Use Cases

----

Generated: 10.10.2023 - 13:31:11
Generated: 18.10.2023 - 17:37:45

10 changes: 7 additions & 3 deletions test/JPP_TestUsecases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,17 @@ Test JPP_0509 / COMPOSITE_EXPRESSIONS / GOODCASE
Description: JSON file containing several parameter assignments in separate lines (different syntax)
Expectation: JsonPreprocessor returns expected value
------------------------------------------------------------------------------------------------------------------------
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_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_0900 / COMMON_SYNTAX_VIOLATIONS / GOODCASE
Description: JSON file with syntax error, that is commented out
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)
------------------------------------------------------------------------------------------------------------------------
Test JPP_0950 / COMMON_SYNTAX_VIOLATIONS / BADCASE
Expand Down Expand Up @@ -288,5 +292,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: 10.10.2023 - 13:31:11
Generated: 18.10.2023 - 17:37:45

4 changes: 2 additions & 2 deletions test/component_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#
# --------------------------------------------------------------------------------------------------------------
#
VERSION = "0.17.0"
VERSION_DATE = "11.10.2023"
VERSION = "0.18.0"
VERSION_DATE = "18.10.2023"
#
# --------------------------------------------------------------------------------------------------------------
#TM***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# XC-CT/ECA3-Queckenstedt
#
# 10.10.2023 - 13:31:11
# 18.10.2023 - 17:37:45
#
# --------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -93,4 +93,12 @@ def test_JPP_0508(self, Description):
def test_JPP_0509(self, Description):
nReturn = CExecute.Execute("JPP_0509")
assert nReturn == 0
# --------------------------------------------------------------------------------------------------------------
# Expected: JsonPreprocessor returns expected value
@pytest.mark.parametrize(
"Description", ["JSON file containing several parameter assignments in separate lines (extended string concatenation)",]
)
def test_JPP_0510(self, Description):
nReturn = CExecute.Execute("JPP_0510")
assert nReturn == 0
# --------------------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# limitations under the License.
# --------------------------------------------------------------------------------------------------------------
#
# test_09_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py
# test_09_CODE_COMMENTS_GOODCASE.py
#
# XC-CT/ECA3-Queckenstedt
#
# 10.10.2023 - 13:31:11
# 18.10.2023 - 17:37:45
#
# --------------------------------------------------------------------------------------------------------------

Expand All @@ -27,14 +27,14 @@

# --------------------------------------------------------------------------------------------------------------

class Test_COMMON_SYNTAX_VIOLATIONS_GOODCASE:
class Test_CODE_COMMENTS_GOODCASE:

# --------------------------------------------------------------------------------------------------------------
# Expected: JsonPreprocessor returns remaining content of JSON file (valid parameters)
@pytest.mark.parametrize(
"Description", ["JSON file with syntax error, that is commented out",]
"Description", ["JSON file with several combinations of code comments",]
)
def test_JPP_0900(self, Description):
nReturn = CExecute.Execute("JPP_0900")
def test_JPP_0600(self, Description):
nReturn = CExecute.Execute("JPP_0600")
assert nReturn == 0
# --------------------------------------------------------------------------------------------------------------
45 changes: 38 additions & 7 deletions test/testconfig/TestConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
# --------------------------------------------------------------------------------------------------------------
#
# 11.10.2023
# 18.10.2023
#
# !!! Temporarily tests are deactivated by the following line commented out:
# # # listofdictUsecases.append(dictUsecase)
Expand Down Expand Up @@ -1970,6 +1970,25 @@
listofdictUsecases.append(dictUsecase)
del dictUsecase
# --------------------------------------------------------------------------------------------------------------
dictUsecase = {}
# can be combined with previous test cases after issue is solved
dictUsecase['TESTID'] = "JPP_0510"
dictUsecase['DESCRIPTION'] = "JSON file containing several parameter assignments in separate lines (extended string concatenation)"
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_0510.jsonp"
dictUsecase['EXPECTEDEXCEPTION'] = None
dictUsecase['EXPECTEDRETURN'] = """
[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/1) > {teststring_1} [STR] : 'prefix.teststring_1.value.suffix_1.suffix_2.suffix_3'
[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/2) > {teststring_2} [STR] : 'teststring_2.value.suffix_1'
[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/3) > {teststring_3} [STR] : 'teststring_3.value.5'
[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/4) > {testdict} [DICT] (1/1) > {key} [DICT] (1/1) > {teststring_4} [STR] : 'teststring_4.initial_value.suffix_1.suffix_2'"""
listofdictUsecases.append(dictUsecase)
del dictUsecase
# --------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------
dictUsecase = {}
dictUsecase['TESTID'] = "JPP_0550"
Expand All @@ -1987,16 +2006,28 @@
# --------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------
dictUsecase = {}
dictUsecase['TESTID'] = "JPP_0900"
dictUsecase['DESCRIPTION'] = "JSON file with syntax error, that is commented out"
dictUsecase['TESTID'] = "JPP_0600"
dictUsecase['DESCRIPTION'] = "JSON file with several combinations of code comments"
dictUsecase['EXPECTATION'] = "JsonPreprocessor returns remaining content of JSON file (valid parameters)"
dictUsecase['SECTION'] = "COMMON_SYNTAX_VIOLATIONS"
dictUsecase['SECTION'] = "CODE_COMMENTS"
dictUsecase['SUBSECTION'] = "GOODCASE"
dictUsecase['HINT'] = None
dictUsecase['COMMENT'] = None
dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0900.jsonp"
dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0600.jsonp"
dictUsecase['EXPECTEDEXCEPTION'] = None
dictUsecase['EXPECTEDRETURN'] = "[DICT] (1/1) > {param} [STR] : 'value'"
dictUsecase['EXPECTEDRETURN'] = """
[DICT] (6/1) > {param1} [STR] : 'value1'
[DICT] (6/2) > {param2} [STR] : 'value2'
[DICT] (6/3) > {testdict1} [DICT] (3/1) > {A} [INT] : 1
[DICT] (6/3) > {testdict1} [DICT] (3/2) > {B} [INT] : 2
[DICT] (6/3) > {testdict1} [DICT] (3/3) > {C} [INT] : 3
[DICT] (6/4) > {testdict2} [DICT] (2/1) > {A} [INT] : 1
[DICT] (6/4) > {testdict2} [DICT] (2/2) > {C} [INT] : 3
[DICT] (6/5) > {testdict3} [DICT] (2/1) > {A} [INT] : 1
[DICT] (6/5) > {testdict3} [DICT] (2/2) > {D} [INT] : 4
[DICT] (6/6) > {testlist} [LIST] (2/1) > [STR] : 'A1'
[DICT] (6/6) > {testlist} [LIST] (2/2) > [STR] : 'D4'
"""
listofdictUsecases.append(dictUsecase)
del dictUsecase
# --------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2182,7 +2213,7 @@
listofdictUsecases.append(dictUsecase)
del dictUsecase
# --------------------------------------------------------------------------------------------------------------

# --------------------------------------------------------------------------------------------------------------



Expand Down
Loading