MCPcopy Create free account
hub / github.com/imroc/req / TestCreateDirectory

Function TestCreateDirectory

internal/util/util_test.go:138–154  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func TestCreateDirectory(t *testing.T) {
139 dir := t.TempDir() + "/testdir"
140 if err := CreateDirectory(dir); err != nil {
141 t.Fatalf("CreateDirectory failed: %v", err)
142 }
143 info, err := os.Stat(dir)
144 if err != nil {
145 t.Fatalf("directory not created: %v", err)
146 }
147 if !info.IsDir() {
148 t.Fatal("not a directory")
149 }
150 // Creating again should not error
151 if err := CreateDirectory(dir); err != nil {
152 t.Fatalf("CreateDirectory on existing dir failed: %v", err)
153 }
154}

Callers

nothing calls this directly

Calls 1

CreateDirectoryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…