diff options
author | Miloslav Trmač <mitr@redhat.com> | 2018-07-19 02:30:33 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-07-19 16:12:49 +0000 |
commit | c020db8cd21cb221cfbe36b264e0ec02999596ed (patch) | |
tree | 4c841f45838a20d21f64c3d2c29c530ef2a5cc88 /libpod | |
parent | cedb4576a4481bc45b0008e7a0c8da0a1f8f858f (diff) | |
download | podman-c020db8cd21cb221cfbe36b264e0ec02999596ed.tar.gz podman-c020db8cd21cb221cfbe36b264e0ec02999596ed.tar.bz2 podman-c020db8cd21cb221cfbe36b264e0ec02999596ed.zip |
Abort a test on nil containers, so that future tests don't panic
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Closes: #1111
Approved by: baude
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/common_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/common_test.go b/libpod/common_test.go index d2379c508..543242130 100644 --- a/libpod/common_test.go +++ b/libpod/common_test.go @@ -12,6 +12,7 @@ import ( "github.com/cri-o/ocicni/pkg/ocicni" "github.com/opencontainers/runtime-tools/generate" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func getTestContainer(id, name, locksDir string) (*Container, error) { @@ -148,8 +149,8 @@ func testContainersEqual(t *testing.T, a, b *Container) { if a == nil && b == nil { return } - assert.NotNil(t, a) - assert.NotNil(t, b) + require.NotNil(t, a) + require.NotNil(t, b) assert.NotNil(t, a.config) assert.NotNil(t, b.config) |