Closed leanenkaa closed 3 years ago
Hello @leonenkoa,
The contains assertion is expecting an array. The map is technicaly not an array. That is why the contains is not working.
You can validate maps with the equal (which can handle complex structures), or validate if a specific map is available with IsNull.
I also will look on creating a containsMap assertion to validate if a specific map, with value is available.
Greetings, @quintush
Hey @quintush, do you have an example with isnull and a map assertion? I’m looking for it as well.
On Fri, 2 Apr 2021 at 13:48 Quintus @.***> wrote:
Hello @leonenkoa https://github.com/leonenkoa,
The contains assertion is expecting an array. The map is technicaly not an array. That is why the contains is not working.
You can validate maps with the equal (which can handle complex structures), or validate if a specific map is available with IsNull.
I also will look on creating a containsMap assertion to validate if a specific map, with value is available.
Greetings, @quintush https://github.com/quintush
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/quintush/helm-unittest/issues/107#issuecomment-812611671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE4PAKPJX35RMUJDI67VBDTGXYO3ANCNFSM42I3F2UQ .
Hello @gcavalcante8808 ,
As a quick answer, Take a look at the ingress tests. It will not have the IsNull, but it does show how to select a specific map.
Greetings, @quintush
Hello @gcavalcante8808,
I have created some examples with mappings. https://github.com/quintush/helm-unittest/blob/71544f7a30e97d280545da8cd5ba61b27d28f75c/test/data/v3/basic/tests/ingress_test.yaml#L72
Hopefully this will help.
Greetings, @quintush
Hi, thank you for the useful plugin. It seems that contains assertion type doesn't support metadata.annotations map. Is this due to any limitations ?