MCPcopy Index your code
hub / github.com/docker/cli / TestCIDFileCloseWithWrite

Function TestCIDFileCloseWithWrite

cli/command/container/create_test.go:73–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestCIDFileCloseWithWrite(t *testing.T) {
74 tempdir := fs.NewDir(t, "test-cid-file")
75 defer tempdir.Remove()
76
77 path := tempdir.Join("cidfile")
78 file, err := newCIDFile(path)
79 assert.NilError(t, err)
80
81 content := "id"
82 assert.NilError(t, file.Write(content))
83
84 actual, err := os.ReadFile(path)
85 assert.NilError(t, err)
86 assert.Check(t, is.Equal(content, string(actual)))
87
88 assert.NilError(t, file.Close())
89 _, err = os.Stat(path)
90 assert.NilError(t, err)
91}
92
93func TestCreateContainerImagePullPolicy(t *testing.T) {
94 const (

Callers

nothing calls this directly

Calls 4

newCIDFileFunction · 0.85
RemoveMethod · 0.65
WriteMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…