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

Function TestReadConfigWithSetConfigFile

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

Source from the content-addressed store, hash-verified

1566}
1567
1568func TestReadConfigWithSetConfigFile(t *testing.T) {
1569 v := New()
1570 v.SetConfigFile("config.yaml") // Dummy value to infer config type from file extension
1571 err := v.ReadConfig(bytes.NewBuffer(yamlMergeExampleSrc))
1572 require.NoError(t, err)
1573 assert.Equal(t, 45000, v.GetInt("hello.pop"))
1574}
1575
1576func TestIsSet(t *testing.T) {
1577 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetConfigFileMethod · 0.80
ReadConfigMethod · 0.80
GetIntMethod · 0.80

Tested by

no test coverage detected