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 <santiago@redhat.com>
This commit is contained in:
Ed Santiago 2021-12-01 08:22:56 -07:00
parent 478f2da5d6
commit c676495468
2 changed files with 3 additions and 3 deletions

View File

@ -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)))
})

View File

@ -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))
})