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

Function saveConfigAndValidateNewFormat

cli/config/config_test.go:284–292  ·  view source on GitHub ↗

Save it and make sure it shows up in new form

(t *testing.T, config *configfile.ConfigFile, configDir string)

Source from the content-addressed store, hash-verified

282
283// Save it and make sure it shows up in new form
284func saveConfigAndValidateNewFormat(t *testing.T, config *configfile.ConfigFile, configDir string) string {
285 t.Helper()
286 assert.NilError(t, config.Save())
287
288 buf, err := os.ReadFile(filepath.Join(configDir, ConfigFileName))
289 assert.NilError(t, err)
290 assert.Check(t, is.Contains(string(buf), `"auths":`))
291 return string(buf)
292}
293
294func TestConfigDir(t *testing.T) {
295 tmpHome := t.TempDir()

Callers 10

TestEmptyConfigDirFunction · 0.85
TestMissingFileFunction · 0.85
TestLoadDanglingSymlinkFunction · 0.85
TestSaveFileToDirsFunction · 0.85
TestEmptyJSONFunction · 0.85
TestNewJSONFunction · 0.85
TestNewJSONNoEmailFunction · 0.85
TestJSONWithPsFormatFunction · 0.85

Calls 2

ContainsMethod · 0.80
SaveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…