MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / TestConfig_MergeWithFile_PluginsEmpty

Function TestConfig_MergeWithFile_PluginsEmpty

internal/config/config_test.go:497–518  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

495}
496
497func TestConfig_MergeWithFile_PluginsEmpty(t *testing.T) {
498 tempFile, err := os.CreateTemp(t.TempDir(), "config-empty-*.yaml")
499 require.NoError(t, err)
500 defer os.Remove(tempFile.Name())
501
502 content := `
503plugins:
504 enabled: []
505`
506
507 _, err = tempFile.WriteString(content)
508 require.NoError(t, err)
509 require.NoError(t, tempFile.Close())
510
511 cfg := &Config{}
512 require.NoError(t, cfg.MergeWithFile(tempFile.Name()))
513
514 assert.Empty(t, cfg.Plugins.Enabled)
515
516 cfg.SetDefaults()
517 assert.Empty(t, cfg.Plugins.Enabled)
518}
519
520func TestConfig_MergeWithFile_PluginsAnsible(t *testing.T) {
521 tempFile, err := os.CreateTemp(t.TempDir(), "config-ansible-*.yaml")

Callers

nothing calls this directly

Calls 4

MergeWithFileMethod · 0.95
SetDefaultsMethod · 0.95
NameMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected