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

Function TestDotEnv

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

Source from the content-addressed store, hash-verified

575}
576
577func TestDotEnv(t *testing.T) {
578 v := New()
579 v.SetConfigType("env")
580 // Read the dotenv data into Viper configuration
581 require.NoError(t, v.ReadConfig(bytes.NewBuffer(dotenvExample)), "Error reading env data")
582
583 assert.Equal(t, "DotEnv Example", v.Get("title_dotenv"))
584}
585
586func TestRemotePrecedence(t *testing.T) {
587 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetConfigTypeMethod · 0.80
ReadConfigMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected