MCPcopy Create free account
hub / github.com/docker/cli / TestEmptyJSON

Function TestEmptyJSON

cli/config/config_test.go:107–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestEmptyJSON(t *testing.T) {
108 tmpHome := t.TempDir()
109
110 fn := filepath.Join(tmpHome, ConfigFileName)
111 err := os.WriteFile(fn, []byte("{}"), 0o600)
112 assert.NilError(t, err)
113
114 config, err := Load(tmpHome)
115 assert.NilError(t, err)
116
117 // Now save it and make sure it shows up in new form
118 saveConfigAndValidateNewFormat(t, config, tmpHome)
119}
120
121func TestMalformedJSON(t *testing.T) {
122 tmpHome := t.TempDir()

Callers

nothing calls this directly

Calls 2

LoadFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…