MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / TestNewFromJsonFile

Function TestNewFromJsonFile

pkg/config/config_windows_test.go:107–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestNewFromJsonFile(t *testing.T) {
108 c := NewWithOpts(WithRun())
109
110 err := c.flags.Parse([]string{"--config-file=_fixtures/fibratus.json"})
111 require.NoError(t, c.viper.BindPFlags(c.flags))
112 require.NoError(t, err)
113 require.NoError(t, c.TryLoadFile(c.GetConfigFile()))
114
115 require.NoError(t, c.Init())
116
117 errs := c.Validate()
118
119 require.Empty(t, errs)
120
121 assert.Equal(t, time.Millisecond*230, c.Aggregator.FlushPeriod)
122 assert.Equal(t, time.Second*8, c.Aggregator.FlushTimeout)
123}

Callers

nothing calls this directly

Calls 8

NewWithOptsFunction · 0.85
WithRunFunction · 0.85
TryLoadFileMethod · 0.80
GetConfigFileMethod · 0.80
EmptyMethod · 0.80
EqualMethod · 0.80
InitMethod · 0.45
ValidateMethod · 0.45

Tested by

no test coverage detected