MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / TestLoadConfigFromEnv

Function TestLoadConfigFromEnv

server/config_test.go:40–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestLoadConfigFromEnv(t *testing.T) {
41 assert.Nil(t, os.Setenv("FS_LISTEN_ADDR", ":17300"))
42 assert.Nil(t, os.Setenv("FS_TUBE_CONFIG__MY_TUBE__KEY", "value"))
43 assert.Nil(t, os.Setenv("FS_RUNTIME_CONFIG__CUSTOM_RUNTIME__NAME", "test"))
44
45 viper.AutomaticEnv()
46
47 c, err := LoadConfigFromEnv()
48 require.Nil(t, err)
49 assertConfig(t, c)
50}
51
52func assertConfig(t *testing.T, c *Config) {
53 assert.Equal(t, ":17300", c.ListenAddr)

Callers

nothing calls this directly

Calls 2

LoadConfigFromEnvFunction · 0.85
assertConfigFunction · 0.85

Tested by

no test coverage detected