From c676495468397b16e228a37c45c3e02bb9832779 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 1 Dec 2021 08:22:56 -0700 Subject: Same as previous, for assertions other than Equal() sed -i -e 's/Expect(\(.*\)\[\(\".*\"\)\])\.To(\(.*\)/Expect(\1).To(HaveKeyWithValue(\2, \3)/' test/e2e/*_test.go Signed-off-by: Ed Santiago --- test/e2e/play_kube_test.go | 4 ++-- test/e2e/run_networking_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index fc939711f..bcab92b97 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -2012,8 +2012,8 @@ spec: ctr := inspect.InspectContainerToJSON() Expect(ctr[0].Config.WorkingDir).To(ContainSubstring("/etc")) - Expect(ctr[0].Config.Labels["key1"]).To(ContainSubstring("value1")) - Expect(ctr[0].Config.Labels["key1"]).To(ContainSubstring("value1")) + Expect(ctr[0].Config.Labels).To(HaveKeyWithValue("key1", ContainSubstring("value1"))) + Expect(ctr[0].Config.Labels).To(HaveKeyWithValue("key1", ContainSubstring("value1"))) Expect(ctr[0].Config.StopSignal).To(Equal(uint(51))) }) diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 22ec27346..d73bd43a7 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -526,7 +526,7 @@ EXPOSE 2004-2005/tcp`, ALPINE) containerConfig := inspect.InspectContainerToJSON() Expect(containerConfig[0].NetworkSettings.Ports).To(Not(BeNil())) - Expect(containerConfig[0].NetworkSettings.Ports["80/tcp"]).To(Not(BeNil())) + Expect(containerConfig[0].NetworkSettings.Ports).To(HaveKeyWithValue("80/tcp", Not(BeNil()))) Expect(containerConfig[0].NetworkSettings.Ports["80/tcp"][0].HostPort).ToNot(Equal(80)) }) -- cgit v1.2.3-54-g00ecf