From 0026075d59b5e6e90786ed21825ac43d4f59fa5a Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 2 Nov 2017 13:17:09 -0500 Subject: libpod/runtime_img_test.go Unit Tests Unit tests for getRegistry related functions. Signed-off-by: baude --- cmd/kpod/create_cli.go | 2 +- cmd/kpod/spec_test.go | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'cmd/kpod') diff --git a/cmd/kpod/create_cli.go b/cmd/kpod/create_cli.go index 1cc00adc5..eaad46591 100644 --- a/cmd/kpod/create_cli.go +++ b/cmd/kpod/create_cli.go @@ -36,7 +36,7 @@ func getAllEnvironmentVariables(envFiles, envInput []string) ([]string, error) { env = append(env, defaultEnvVariables...) } // Each environment variable must be in the K=V format - for _,i := range env{ + for _, i := range env { spliti := strings.Split(i, "=") if len(spliti) != 2 { return env, errors.Errorf("environment variables must be in the format KEY=VALUE: %s is invalid", i) diff --git a/cmd/kpod/spec_test.go b/cmd/kpod/spec_test.go index 2f023f201..c3de84324 100644 --- a/cmd/kpod/spec_test.go +++ b/cmd/kpod/spec_test.go @@ -1,20 +1,19 @@ package main - import ( - "testing" "reflect" + "testing" - "github.com/stretchr/testify/assert" spec "github.com/opencontainers/runtime-spec/specs-go" + "github.com/stretchr/testify/assert" ) func TestCreateConfig_GetVolumeMounts(t *testing.T) { data := spec.Mount{ Destination: "/foobar", - Type: "bind", - Source: "foobar", - Options: []string{"ro", "rbind"}, + Type: "bind", + Source: "foobar", + Options: []string{"ro", "rbind"}, } config := createConfig{ volumes: []string{"foobar:/foobar:ro"}, @@ -26,11 +25,11 @@ func TestCreateConfig_GetVolumeMounts(t *testing.T) { func TestCreateConfig_GetTmpfsMounts(t *testing.T) { data := spec.Mount{ Destination: "/homer", - Type: "tmpfs", - Source: "tmpfs", - Options: []string{"rw", "size=787448k", "mode=1777"}, + Type: "tmpfs", + Source: "tmpfs", + Options: []string{"rw", "size=787448k", "mode=1777"}, } - config:= createConfig{ + config := createConfig{ tmpfs: []string{"/homer:rw,size=787448k,mode=1777"}, } tmpfsMount := config.GetTmpfsMounts() -- cgit v1.2.3-54-g00ecf