Skip to content

Commit 45d02e3

Browse files
Merge pull request #191 from test-fullautomation/HolQue/task/selftest_maintenance
Added self test cases JPP_0512 and JPP_0513
2 parents 9bfbe92 + 16a6672 commit 45d02e3

12 files changed

+394
-32
lines changed

config/robotframework_aio/release_items_JsonPreprocessor.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
* Improved format of nested parameters; improved error messages
6161
* Some bugs fixed in implicitly created data structures
6262
* Improved index handling together with nested parameters
63+
* Self test extended by further test cases
64+
65+
All JsonPreprocessor test cases: `JPP_TestUsecases.html <https://htmlpreview.github.io/?https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/JPP_TestUsecases.html>`_
6366
"
6467
]
6568
}

test/JPP_TestUsecases.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ JPP_0508|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string conc
7070
JPP_0509|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (different syntax)
7171
JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (extended string concatenation)
7272
JPP_0511|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a list; list index is defined by a parameter
73+
JPP_0512|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression
74+
JPP_0513|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes
7375
JPP_0550|COMPOSITE_EXPRESSIONS|BADCASE|JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside)
7476
JPP_0600|CODE_COMMENTS|GOODCASE|JSON file with several combinations of code comments
7577
JPP_0950|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (1)
@@ -79,6 +81,7 @@ JPP_0953|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (4): file
7981
JPP_0954|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (5): file is empty (multiple pairs of brackets only)
8082
JPP_1000|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly
8183
JPP_1001|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly (same key names at all levels)
84+
JPP_1002|IMPLICIT_CREATION|GOODCASE|JSON file with combinations of implicit and explicit creation / with and without initialization
8285
JPP_1050|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (1)
8386
JPP_1051|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (2)
8487
JPP_1052|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (3)

test/JPP_TestUsecases.html

Lines changed: 120 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,6 +2373,72 @@
23732373
71
23742374
</b></font></td>
23752375

2376+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2377+
<font size="2" face="Arial" color="#595959">
2378+
<b>
2379+
<a target="_blank" href="https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_0512.jsonp">JPP_0512</a>
2380+
</b></font></td>
2381+
2382+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2383+
<font size="2" face="Arial" color="#4169E1">
2384+
COMPOSITE_EXPRESSIONS
2385+
</font></td>
2386+
2387+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2388+
<font size="2" face="Arial" color="#008000">
2389+
GOODCASE
2390+
</font></td>
2391+
2392+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="left">
2393+
<font size="2" face="Arial" color="#595959"><i>
2394+
<b>JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression</b><br>
2395+
Expected: JsonPreprocessor returns expected value
2396+
2397+
2398+
</i></font></td>
2399+
2400+
2401+
</tr>
2402+
<tr valign="middle" align="left">
2403+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
2404+
<font size="2" face="Arial" color="#FF0000">
2405+
<b>
2406+
72
2407+
</b></font></td>
2408+
2409+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2410+
<font size="2" face="Arial" color="#595959">
2411+
<b>
2412+
<a target="_blank" href="https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_0513.jsonp">JPP_0513</a>
2413+
</b></font></td>
2414+
2415+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2416+
<font size="2" face="Arial" color="#4169E1">
2417+
COMPOSITE_EXPRESSIONS
2418+
</font></td>
2419+
2420+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2421+
<font size="2" face="Arial" color="#008000">
2422+
GOODCASE
2423+
</font></td>
2424+
2425+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="left">
2426+
<font size="2" face="Arial" color="#595959"><i>
2427+
<b>JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes</b><br>
2428+
Expected: JsonPreprocessor returns expected value
2429+
2430+
2431+
</i></font></td>
2432+
2433+
2434+
</tr>
2435+
<tr valign="middle" align="left">
2436+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
2437+
<font size="2" face="Arial" color="#FF0000">
2438+
<b>
2439+
73
2440+
</b></font></td>
2441+
23762442
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
23772443
<font size="2" face="Arial" color="#595959">
23782444
<b>
@@ -2404,7 +2470,7 @@
24042470
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
24052471
<font size="2" face="Arial" color="#FF0000">
24062472
<b>
2407-
72
2473+
74
24082474
</b></font></td>
24092475

24102476
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2437,7 +2503,7 @@
24372503
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
24382504
<font size="2" face="Arial" color="#FF0000">
24392505
<b>
2440-
73
2506+
75
24412507
</b></font></td>
24422508

24432509
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2470,7 +2536,7 @@
24702536
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
24712537
<font size="2" face="Arial" color="#FF0000">
24722538
<b>
2473-
74
2539+
76
24742540
</b></font></td>
24752541

24762542
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2503,7 +2569,7 @@
25032569
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
25042570
<font size="2" face="Arial" color="#FF0000">
25052571
<b>
2506-
75
2572+
77
25072573
</b></font></td>
25082574

25092575
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2536,7 +2602,7 @@
25362602
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
25372603
<font size="2" face="Arial" color="#FF0000">
25382604
<b>
2539-
76
2605+
78
25402606
</b></font></td>
25412607

25422608
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2569,7 +2635,7 @@
25692635
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
25702636
<font size="2" face="Arial" color="#FF0000">
25712637
<b>
2572-
77
2638+
79
25732639
</b></font></td>
25742640

25752641
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2602,7 +2668,7 @@
26022668
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
26032669
<font size="2" face="Arial" color="#FF0000">
26042670
<b>
2605-
78
2671+
80
26062672
</b></font></td>
26072673

26082674
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2635,7 +2701,7 @@
26352701
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
26362702
<font size="2" face="Arial" color="#FF0000">
26372703
<b>
2638-
79
2704+
81
26392705
</b></font></td>
26402706

26412707
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2668,7 +2734,40 @@
26682734
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
26692735
<font size="2" face="Arial" color="#FF0000">
26702736
<b>
2671-
80
2737+
82
2738+
</b></font></td>
2739+
2740+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2741+
<font size="2" face="Arial" color="#595959">
2742+
<b>
2743+
<a target="_blank" href="https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_1002.jsonp">JPP_1002</a>
2744+
</b></font></td>
2745+
2746+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2747+
<font size="2" face="Arial" color="#4169E1">
2748+
IMPLICIT_CREATION
2749+
</font></td>
2750+
2751+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
2752+
<font size="2" face="Arial" color="#008000">
2753+
GOODCASE
2754+
</font></td>
2755+
2756+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="left">
2757+
<font size="2" face="Arial" color="#595959"><i>
2758+
<b>JSON file with combinations of implicit and explicit creation / with and without initialization</b><br>
2759+
Expected: JsonPreprocessor returns values
2760+
2761+
2762+
</i></font></td>
2763+
2764+
2765+
</tr>
2766+
<tr valign="middle" align="left">
2767+
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
2768+
<font size="2" face="Arial" color="#FF0000">
2769+
<b>
2770+
83
26722771
</b></font></td>
26732772

26742773
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2701,7 +2800,7 @@
27012800
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
27022801
<font size="2" face="Arial" color="#FF0000">
27032802
<b>
2704-
81
2803+
84
27052804
</b></font></td>
27062805

27072806
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2734,7 +2833,7 @@
27342833
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
27352834
<font size="2" face="Arial" color="#FF0000">
27362835
<b>
2737-
82
2836+
85
27382837
</b></font></td>
27392838

27402839
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2767,7 +2866,7 @@
27672866
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
27682867
<font size="2" face="Arial" color="#FF0000">
27692868
<b>
2770-
83
2869+
86
27712870
</b></font></td>
27722871

27732872
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2800,7 +2899,7 @@
28002899
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
28012900
<font size="2" face="Arial" color="#FF0000">
28022901
<b>
2803-
84
2902+
87
28042903
</b></font></td>
28052904

28062905
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2833,7 +2932,7 @@
28332932
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
28342933
<font size="2" face="Arial" color="#FF0000">
28352934
<b>
2836-
85
2935+
88
28372936
</b></font></td>
28382937

28392938
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2866,7 +2965,7 @@
28662965
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
28672966
<font size="2" face="Arial" color="#FF0000">
28682967
<b>
2869-
86
2968+
89
28702969
</b></font></td>
28712970

28722971
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2899,7 +2998,7 @@
28992998
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
29002999
<font size="2" face="Arial" color="#FF0000">
29013000
<b>
2902-
87
3001+
90
29033002
</b></font></td>
29043003

29053004
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2932,7 +3031,7 @@
29323031
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
29333032
<font size="2" face="Arial" color="#FF0000">
29343033
<b>
2935-
88
3034+
91
29363035
</b></font></td>
29373036

29383037
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2965,7 +3064,7 @@
29653064
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
29663065
<font size="2" face="Arial" color="#FF0000">
29673066
<b>
2968-
89
3067+
92
29693068
</b></font></td>
29703069

29713070
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -2998,7 +3097,7 @@
29983097
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
29993098
<font size="2" face="Arial" color="#FF0000">
30003099
<b>
3001-
90
3100+
93
30023101
</b></font></td>
30033102

30043103
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -3031,7 +3130,7 @@
30313130
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="right">
30323131
<font size="2" face="Arial" color="#FF0000">
30333132
<b>
3034-
91
3133+
94
30353134
</b></font></td>
30363135

30373136
<td colspan="1" valign="center" bgcolor="#F5F5F5" align="middle">
@@ -3065,7 +3164,7 @@
30653164
</tbody></table></div>
30663165
<div>&nbsp;</div>
30673166
<hr width="100%" color="#FF8C00" align="center">
3068-
<div align="center"><font size="2" color="#27408B">Generated: 10.01.2024 - 12:25:22</font></div>
3167+
<div align="center"><font size="2" color="#27408B">Generated: 16.01.2024 - 13:22:08</font></div>
30693168
<div>&nbsp;</div>
30703169
</body></html>
30713170

test/JPP_TestUsecases.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,26 @@ Test Use Cases
773773

774774
----
775775

776+
* **Test JPP_0512**
777+
778+
[COMPOSITE_EXPRESSIONS / GOODCASE]
779+
780+
**JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression**
781+
782+
Expected: JsonPreprocessor returns expected value
783+
784+
----
785+
786+
* **Test JPP_0513**
787+
788+
[COMPOSITE_EXPRESSIONS / GOODCASE]
789+
790+
**JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes**
791+
792+
Expected: JsonPreprocessor returns expected value
793+
794+
----
795+
776796
* **Test JPP_0550**
777797

778798
[COMPOSITE_EXPRESSIONS / BADCASE]
@@ -865,6 +885,16 @@ Test Use Cases
865885

866886
----
867887

888+
* **Test JPP_1002**
889+
890+
[IMPLICIT_CREATION / GOODCASE]
891+
892+
**JSON file with combinations of implicit and explicit creation / with and without initialization**
893+
894+
Expected: JsonPreprocessor returns values
895+
896+
----
897+
868898
* **Test JPP_1050**
869899

870900
[IMPLICIT_CREATION / BADCASE]
@@ -987,5 +1017,5 @@ Test Use Cases
9871017

9881018
----
9891019

990-
Generated: 10.01.2024 - 12:25:22
1020+
Generated: 16.01.2024 - 13:22:08
9911021

0 commit comments

Comments
 (0)