MCPcopy
hub / github.com/spf13/viper / TestMergeConfigWithSetConfigFile

Function TestMergeConfigWithSetConfigFile

viper_test.go:2093–2099  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2091}
2092
2093func TestMergeConfigWithSetConfigFile(t *testing.T) {
2094 v := New()
2095 v.SetConfigFile("config.yaml") // Dummy value to infer config type from file extension
2096 err := v.MergeConfig(bytes.NewBuffer(yamlMergeExampleSrc))
2097 require.NoError(t, err)
2098 assert.Equal(t, 45000, v.GetInt("hello.pop"))
2099}
2100
2101func TestMergeConfigOverrideType(t *testing.T) {
2102 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetConfigFileMethod · 0.80
MergeConfigMethod · 0.80
GetIntMethod · 0.80

Tested by

no test coverage detected