test-fullautomation / python-jsonpreprocessor

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

Error messages (41) #383

Open HolQue opened 1 week ago

HolQue commented 1 week ago

The [import] tag requires a string (that is interpreted as file). Therefore the value type must be checked. This is not implemented and the current error handling is insufficient.

Examples:

"[import]" : 123
Error: 'argument of type 'int' is not iterable
"[import]" : [1,2,3]
Error: ''list' object has no attribute 'strip'
"[import]" : {"A" : 1, "B" : 2}
Error: ''dict' object has no attribute 'strip'
"values" : {"A" : 1, "B" : 2},
"[import]" : ${values}['A']
Error: 'File '%values%['A']' is not existing!'!

Expected error handling:

  1. Check value type, error if not a string
  2. Check existence of file, error if file does not exist
  3. Check file content, error in case of content related error
test-fullautomation commented 1 week ago

Hi Holger, please provide tests for this. Thank you, Thomas

HolQue commented 1 week ago

JPP_1161 JPP_1162 JPP_1163 JPP_1164

namsonx commented 3 days ago

Hello Holger,

This ticket was solved on stabi branch, could you please help us check again.

Thank you, Son

HolQue commented 2 days ago

Current error:

'The value of [import] parameter must be 'str' but receiving the value '123''

Please rephrase to:

The [import] key requires a value of type 'str', but the type is 'int'.