MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / TestConfigDefaults

Function TestConfigDefaults

pkg/config/config_test.go:141–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestConfigDefaults(t *testing.T) {
142 t.Parallel()
143 a := assertions.New(t)
144
145 config := InitializeWithDefaults("test", "test", defaults)
146 a.So(config, should.NotBeNil)
147
148 settings := new(example)
149
150 // parse no command line args
151 err := config.Parse()
152 a.So(err, should.BeNil)
153
154 // unmarshal
155 err = config.Unmarshal(settings)
156 a.So(err, should.BeNil)
157
158 a.So(settings, should.Resemble, defaults)
159}
160
161func TestConfigEnv(t *testing.T) { //nolint:paralleltest // Parallel tests conflict with t.Setenv.
162 a := assertions.New(t)

Callers

nothing calls this directly

Calls 4

InitializeWithDefaultsFunction · 0.85
NewMethod · 0.65
ParseMethod · 0.65
UnmarshalMethod · 0.65

Tested by

no test coverage detected