MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / Test04Compatibility

Function Test04Compatibility

internal/config/compatibility_test.go:17–37  ·  view source on GitHub ↗

Test04Compatibility tests if a configuration file for ContainerSSH version 0.4 can be read.

(t *testing.T)

Source from the content-addressed store, hash-verified

15
16// Test04Compatibility tests if a configuration file for ContainerSSH version 0.4 can be read.
17func Test04Compatibility(t *testing.T) {
18 logger := log.NewTestLogger(t)
19
20 logger.Info(message.NewMessage("TEST", "FYI: any deprecation notices in this test are intentional."))
21
22 testFile, err := os.Open("_testdata/0.4.yaml")
23 assert.NoError(t, err)
24 reader, err := config.NewReaderLoader(
25 testFile,
26 logger,
27 config.FormatYAML,
28 )
29 assert.NoError(t, err)
30
31 cfg := configuration.AppConfig{}
32 structutils.Defaults(&cfg)
33 err = reader.Load(context.Background(), &cfg)
34 assert.NoError(t, err)
35 err = cfg.Validate(false)
36 assert.NoError(t, err)
37}

Callers

nothing calls this directly

Calls 7

ValidateMethod · 0.95
NewTestLoggerFunction · 0.92
NewMessageFunction · 0.92
NewReaderLoaderFunction · 0.92
DefaultsFunction · 0.92
InfoMethod · 0.65
LoadMethod · 0.65

Tested by

no test coverage detected