-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List access with index parameters does not work #184
Comments
Hello Holger, Regarding to the use case (2)
Sorry but I'm not agree with you that it's a context of lists because user use the syntax Thank you, |
Hi Son, this is a BADCASE test and I clearly pointed out my expectation:
|
Hello Holger, The syntax with square brackets Thank you, |
"we want to access the sub-element of a dictionary" NO! This depends on the data type of the parameter the square bracket expression belongs to. If it's a list and the index is a string, then this is an error! Therefore I told that it's a BADCASE test. Some days ago I updated the documentation of the JsonPreprocessor and explained these expectations in detail. Please take a look at this. |
Hello Holger, I understood you define a BADCASE test, how about user define a json file like below:
Now, we consider this scenario is valid or invalid? Thank you, |
Hello Holger, After our short discussion, now I understood the context. Thank you, |
Hello Holger, I pushed the commit 8461eb19a02 to the stabi branch to cover all use cases you mentioned in this ticket. Thank you, |
Only one tiny aspect left:
now causes:
"or slices"? As per my understanding we do not support slicing. Therefore we must not tell the opposite in error messages. Maybe this is the original error message from Python interpreter. In this case we have to provide an own error message. A small code example about how to do this I already communicated in |
Hello Holger, Actually, we support slicing as Python interpreter does.
Then I get the result below:
So, I think we don't need to update the error message. Thank you, |
Hi Thomas, I am confused now. Is slicing a confirmed feature or not? Because of my understanding was, that slicing is not supported (= not a supported feature). Because if slicing is supported officially, we have to explain this feature in documentation. And also in TestsuitesManagement Tutorial. And the feature has to be mentioned in history of JsonPreprocessor. And self tests are needed for both the TestsuitesManagement and the JsonPreprocessor. All these things are not yet done. How to continue? |
Small check with
Outcome: slicing feature needs to be specified in more detail before we can release it. Update: Also param2 works now (slicing detected). |
Hi both, |
Hi Son, |
Hi Thomas, The list slicing is currently working if slicing indexes are a number, and the slicing doesn't work while slicing indexes are nested parameter. Thank you, |
Because of this part still needs to be fixed. |
Hello Holger, #205 and #184 (comment) are solved. Thank you, |
Hi Son, the error message "list indices must be integers or slices, not str'" still proposes slices. Because of the decision to block slicing, this part of the error message is not correct. |
The list access code examples from above work now. Error message:
is still wrong. But this is already tracked by: Therefore this issue can be closed. |
released with RobotFramework AIO 0.12.0 |
(1)
The JSON code
causes a parameter with name
${testlist}[${intval}]
, typeint
and value4
.But expected is that the second element of the
testlist
is changed from value2
to value4
.Update: Retest successful; (1) is solved.
(2)
Now the index parameter is wrapped in single quotes:
Result:
The implicit creation of data structures based on nested parameter does not enable yet.
That's wrong, because in context of lists the 'implicit creation' has no meaning.
Expected is an error message telling that list indices are expected to be of type int.
Reference: JPP_0551
Update: Retest successful; (2) is solved.
(3)
The JSON code
causes a parameter with name
${testlist[${intval}]}
But expected is an error message telling that indices must be placed outside the curly brackets.
Reference: JPP_0552
Update: Retest successful; (3) is solved.
The text was updated successfully, but these errors were encountered: