MCPcopy Index your code
hub / github.com/docker/docker-agent / TestFileCache_corruptFile

Function TestFileCache_corruptFile

pkg/cache/cache_test.go:168–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

166}
167
168func TestFileCache_corruptFile(t *testing.T) {
169 t.Parallel()
170 dir := t.TempDir()
171 path := filepath.Join(dir, "cache.json")
172 require.NoError(t, os.WriteFile(path, []byte("not json"), 0o600))
173
174 _, err := New(Config{Enabled: true, Path: path})
175 assert.Error(t, err)
176}
177
178// TestFileCache_persistenceFailureKeepsInMemory verifies that a Store
179// whose underlying file write fails still updates the in-memory map: a

Callers

nothing calls this directly

Calls 2

NewFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected