MCPcopy
hub / github.com/canopy-network/canopy / TestFileConfig

Function TestFileConfig

lib/config_test.go:31–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestFileConfig(t *testing.T) {
32 filePath := "./test_config"
33 // define a variable to test upon
34 config := DefaultConfig()
35 // write to file
36 require.NoError(t, config.WriteToFile(filePath))
37 defer os.RemoveAll(filePath)
38 // read from file
39 got, err := NewConfigFromFile(filePath)
40 require.NoError(t, err)
41 // compare got vs expected
42 require.Equal(t, config, got)
43}

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.80
DefaultConfigFunction · 0.70
NewConfigFromFileFunction · 0.70
WriteToFileMethod · 0.45

Tested by

no test coverage detected