MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestSpoolStdinToTemp_CleanupRemovesFile

Function TestSpoolStdinToTemp_CleanupRemovesFile

cmd/stdin_test.go:109–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func TestSpoolStdinToTemp_CleanupRemovesFile(t *testing.T) {
110 r := bytes.NewReader([]byte("data"))
111
112 path, _, cleanup, err := spoolStdinToTemp(r)
113 if err != nil {
114 t.Fatalf("unexpected error: %v", err)
115 }
116
117 if err := cleanup(); err != nil {
118 t.Fatalf("cleanup error: %v", err)
119 }
120
121 if _, err := os.Stat(path); !os.IsNotExist(err) {
122 t.Errorf("expected temp file to be removed after cleanup, stat err = %v", err)
123 }
124}
125
126type failingReader struct {
127 err error

Callers

nothing calls this directly

Calls 1

spoolStdinToTempFunction · 0.85

Tested by

no test coverage detected