Files
virtual-kubelet/vendor/github.com/hyperhq/libcompose/lookup/simple_env_test.go
2017-12-05 17:53:58 -06:00

29 lines
671 B
Go

package lookup
import (
"testing"
)
func TestOsEnvLookup(t *testing.T) {
// Putting bare minimun value for serviceName and config as there are
// not important on this test.
serviceName := "anything"
osEnvLookup := &OsEnvLookup{}
envs := osEnvLookup.Lookup("PATH", serviceName, nil)
if len(envs) != 1 {
t.Fatalf("Expected envs to contains one element, but was %v", envs)
}
envs = osEnvLookup.Lookup("path", serviceName, nil)
if len(envs) != 0 {
t.Fatalf("Expected envs to be empty, but was %v", envs)
}
envs = osEnvLookup.Lookup("DOES_NOT_EXIST", serviceName, nil)
if len(envs) != 0 {
t.Fatalf("Expected envs to be empty, but was %v", envs)
}
}