We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi.
I'm trying to test the existence of an item of an array without using any positional value using the latest version of the plugin.
Yaml to be tested is :
spec: scopes: - phony-service.phony:graphql
Please note that phony-service.phony:graphql is not a key/value pair but a whole string.
phony-service.phony:graphql
The following assertion fails:
asserts: - contains: path: spec.scopes content: phony-service.phony:graphql count: 1 any: true
with that odd error:
- asserts[0] `contains` fail Template: anything/templates/apiresource.yaml DocumentIndex: 0 Path: spec.scopes Expected to contain: - phony-service.phony:graphql Actual: - phony-service.phony:graphql
Whereas the "positional" assertation works:
asserts: - equal: path: spec.scopes[0] value: "phony-service.phony:graphql"
Any idea about what I could have missed ? I have tried to put the item content between quotes. Same error.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered:
Some additional info about that issue
If the yaml to be tested is:
spec: scopes: - phony-service.phony:graphql - name: something
Then the error is:
- asserts[0] `contains` fail Template: anything/templates/apiresource.yaml DocumentIndex: 0 Path: spec.scopes Expected to contain: - phony-service.phony:graphql Actual: - phony-service.phony:graphql - name: something
Shouldn't any: true prevent this ?
any: true
Edit: if I remove any or set it to false, it does work. Shouldn't it be the contrary ?
any
false
Sorry, something went wrong.
Ok, the plot thickens....
It seems the issue is really related to the fact this item is not a key/value pair. Because a normal key/value pair item does not raise the issue.
Hello @jeratora,
The plot is indeed that the contains, only expects key/value pairs. You can also see it in the contains unittests
I will look if it is possible to expand the contains to also look at only values.
Greetings, @quintush
quintush
No branches or pull requests
Hi.
I'm trying to test the existence of an item of an array without using any positional value using the latest version of the plugin.
Yaml to be tested is :
Please note that
phony-service.phony:graphql
is not a key/value pair but a whole string.The following assertion fails:
with that odd error:
Whereas the "positional" assertation works:
Any idea about what I could have missed ? I have tried to put the item content between quotes. Same error.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: