MCPcopy Create free account
hub / github.com/nginx-proxy/docker-gen / TestPathExists

Function TestPathExists

internal/utils/utils_test.go:30–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestPathExists(t *testing.T) {
31 file, err := os.CreateTemp("", "test")
32 if err != nil {
33 t.Fatal(err)
34 }
35 defer os.Remove(file.Name())
36
37 exists, err := PathExists(file.Name())
38 assert.NoError(t, err)
39 assert.True(t, exists)
40
41 exists, err = PathExists("/wrong/path")
42 assert.NoError(t, err)
43 assert.False(t, exists)
44}

Callers

nothing calls this directly

Calls 1

PathExistsFunction · 0.85

Tested by

no test coverage detected