MCPcopy
hub / github.com/helm/helm / TestAtomicWriteFile_CreateTempError

Function TestAtomicWriteFile_CreateTempError

internal/fileutil/fileutil_test.go:63–73  ·  view source on GitHub ↗

TestAtomicWriteFile_CreateTempError tests the error path when os.CreateTemp fails

(t *testing.T)

Source from the content-addressed store, hash-verified

61
62// TestAtomicWriteFile_CreateTempError tests the error path when os.CreateTemp fails
63func TestAtomicWriteFile_CreateTempError(t *testing.T) {
64 invalidPath := "/invalid/path/that/does/not/exist/testfile"
65
66 reader := bytes.NewReader([]byte("test content"))
67 mode := os.FileMode(0644)
68
69 err := AtomicWriteFile(invalidPath, reader, mode)
70 if err == nil {
71 t.Error("Expected error when CreateTemp fails, but got nil")
72 }
73}
74
75// TestAtomicWriteFile_EmptyContent tests with empty content
76func TestAtomicWriteFile_EmptyContent(t *testing.T) {

Callers

nothing calls this directly

Calls 2

AtomicWriteFileFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…