github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/types_test.go (about) 1 // Copyright (c) 2017 Intel Corporation 2 // 3 // SPDX-License-Identifier: Apache-2.0 4 // 5 6 package virtcontainers 7 8 import ( 9 "testing" 10 11 "github.com/stretchr/testify/assert" 12 ) 13 14 func testIsSandbox(t *testing.T, cType ContainerType, expected bool) { 15 assert.Equal(t, cType.IsSandbox(), expected) 16 } 17 18 func TestIsPodSandboxTrue(t *testing.T) { 19 testIsSandbox(t, PodSandbox, true) 20 } 21 22 func TestIsPodContainerFalse(t *testing.T) { 23 testIsSandbox(t, PodContainer, false) 24 } 25 26 func TestIsSandboxUnknownContainerTypeFalse(t *testing.T) { 27 testIsSandbox(t, UnknownContainerType, false) 28 }