test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

Nested ${} expression not resolved (JPP_0358) #109

Closed HolQue closed 8 months ago

HolQue commented 11 months ago

The test case JPP_0358 contains a nested ${} expression, with more opening elements (${) than closing elements (}):

"val6" : "ABC${p${ara}m"

Previously the JsonPreprocessor has thrown this exception:

Expecting value:

The latest version of the JsonPreprocessor does not throw an exception any more, but returns:

'ABC${param'

That's wrong.

The expectation is an exception with error message telling about an opening and closing elements mismatch.

test-fullautomation commented 9 months ago

@namsonx : What is the status of this issue?

test-fullautomation commented 8 months ago

Hi @namsonx , what is the status of this ticket? Thank you, Thomas

test-fullautomation commented 8 months ago

Holger activates the test and gives feedback.

HolQue commented 8 months ago

Current error message is:

list index out of range

But expected is something like: opening and closing elements mismatch.

See also:

https://github.com/test-fullautomation/python-jsonpreprocessor/issues/77#issue-1769668501

namsonx commented 8 months ago

Hello Holger,

I had push new commit 9a66c266a to stabi branch The error message now look like below:

Exception: Invalid syntax! An opened or closed curly brackets are missing in value 'ABC${p${ara}m'.
           Please check value 'ABC${p${ara}m' in config file!!!

Thank you, Son

test-fullautomation commented 8 months ago

Hi Holger, please test. Thank you, Thomas

HolQue commented 8 months ago

Hi Son,

only a tiny wish left ;-)

Please exchange:

Exception: Invalid syntax! An opened or closed curly brackets are missing in value 'ABC${p${ara}m'.
           Please check value 'ABC${p${ara}m' in config file!!!

by:

Exception: Invalid syntax! One or more than one opened or closed curly bracket is missing in expression 'ABC${p${ara}m'.
           Please check the configuration file of the executed test!

This avoids the singular/plural mismatch, avoids redundancy, and the term 'expression' is a more generic one than 'value' (because it can also be the name of a parameter).

namsonx commented 8 months ago

Hello @HolQue ,

I modified the error message in this case based on your comment above. With this modification of the error message, it makes test cases JPP_0356-(VALUE_DETECTION)-[BADCASE], JPP_0358-(VALUE_DETECTION)-[BADCASE] are failed (due to logout comparison).

Could you please help me modify the expectation of these test cases above to adapt with my new pull-request on stabi branch.

Thank you, Son

test-fullautomation commented 8 months ago

Hi Holger, this can be closed, too? Thank you Thomas

HolQue commented 8 months ago

Retest successful. Issue can be closed.