MCPcopy
hub / github.com/dapr/dapr / TestSetEnvVariables

Function TestSetEnvVariables

utils/utils_test.go:51–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestSetEnvVariables(t *testing.T) {
52 t.Run("set environment variables success", func(t *testing.T) {
53 err := SetEnvVariables(map[string]string{
54 "testKey": "testValue",
55 })
56 require.NoError(t, err)
57 assert.Equal(t, "testValue", os.Getenv("testKey"))
58 })
59 t.Run("set environment variables failed", func(t *testing.T) {
60 err := SetEnvVariables(map[string]string{
61 "": "testValue",
62 })
63 require.Error(t, err)
64 assert.NotEqual(t, "testValue", os.Getenv(""))
65 })
66}
67
68func TestGetIntValFromStringVal(t *testing.T) {
69 tcs := []struct {

Callers

nothing calls this directly

Calls 4

SetEnvVariablesFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected