diff options
author | Ed Santiago <santiago@redhat.com> | 2021-11-30 09:15:44 -0700 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2021-11-30 09:51:06 -0700 |
commit | 12787963b04f91a7fec9aa0d6915666e43aeb269 (patch) | |
tree | a20496b9a5221c6bd042fd5ad93c46f61a3f228f /test/e2e/trust_test.go | |
parent | 3fac03cf04e68eb3351aff8c33bac6bea85810f6 (diff) | |
download | podman-12787963b04f91a7fec9aa0d6915666e43aeb269.tar.gz podman-12787963b04f91a7fec9aa0d6915666e43aeb269.tar.bz2 podman-12787963b04f91a7fec9aa0d6915666e43aeb269.zip |
e2e tests: more cleanup of BeTrue()s
Write a BeValidJSON() matcher, and replace IsJSONOutputValid():
sed -i -e 's/Expect(\(.*\)\.IsJSONOutputValid()).To(BeTrue())/Expect(\1.OutputToString())\.To(BeValidJSON())/' test/e2e/*_test.go
(Plus a few manual tweaks)
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/e2e/trust_test.go')
-rw-r--r-- | test/e2e/trust_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/e2e/trust_test.go b/test/e2e/trust_test.go index b591e1c02..9a0d57d7a 100644 --- a/test/e2e/trust_test.go +++ b/test/e2e/trust_test.go @@ -76,7 +76,7 @@ var _ = Describe("Podman trust", func() { session := podmanTest.Podman([]string{"image", "trust", "show", "--registrypath", filepath.Join(INTEGRATION_ROOT, "test"), "--policypath", filepath.Join(INTEGRATION_ROOT, "test/policy.json"), "--json"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(session.IsJSONOutputValid()).To(BeTrue()) + Expect(session.OutputToString()).To(BeValidJSON()) var teststruct []map[string]string json.Unmarshal(session.Out.Contents(), &teststruct) Expect(len(teststruct)).To(Equal(3)) @@ -118,7 +118,7 @@ var _ = Describe("Podman trust", func() { Expect(session).Should(Exit(0)) contents, err := ioutil.ReadFile(filepath.Join(INTEGRATION_ROOT, "test/policy.json")) Expect(err).ShouldNot(HaveOccurred()) - Expect(session.IsJSONOutputValid()).To(BeTrue()) + Expect(session.OutputToString()).To(BeValidJSON()) Expect(string(session.Out.Contents())).To(Equal(string(contents) + "\n")) }) }) |