mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-28 20:15:51 +00:00
Convert virtcontainers tests to testify/assert to make the virtcontainers tests more readable. fixes #156 Signed-off-by: Julio Montes <julio.montes@intel.com>
29 lines
569 B
Go
29 lines
569 B
Go
// Copyright (c) 2017 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package virtcontainers
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func testIsSandbox(t *testing.T, cType ContainerType, expected bool) {
|
|
assert.Equal(t, cType.IsSandbox(), expected)
|
|
}
|
|
|
|
func TestIsPodSandboxTrue(t *testing.T) {
|
|
testIsSandbox(t, PodSandbox, true)
|
|
}
|
|
|
|
func TestIsPodContainerFalse(t *testing.T) {
|
|
testIsSandbox(t, PodContainer, false)
|
|
}
|
|
|
|
func TestIsSandboxUnknownContainerTypeFalse(t *testing.T) {
|
|
testIsSandbox(t, UnknownContainerType, false)
|
|
}
|