MCPcopy
hub / github.com/containerd/containerd / TestLogFileAbsolutePath

Function TestLogFileAbsolutePath

pkg/cio/io_test.go:65–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestLogFileAbsolutePath(t *testing.T) {
66 res, err := LogFile(prefix + "/full/path/file.txt")("!")
67 require.NoError(t, err)
68 expected := fmt.Sprintf("file://%s/full/path/file.txt", urlPrefix)
69 assert.Equal(t, expected, res.Config().Stdout)
70 assert.Equal(t, expected, res.Config().Stderr)
71
72 // Test parse back
73 parsed, err := url.Parse(res.Config().Stdout)
74 assert.NoError(t, err)
75 assert.Equal(t, "file", parsed.Scheme)
76 assert.Equal(t, urlPrefix+"/full/path/file.txt", parsed.Path)
77}
78
79func TestLogFileFailOnRelativePath(t *testing.T) {
80 _, err := LogFile("./file.txt")("!")

Callers

nothing calls this directly

Calls 2

LogFileFunction · 0.85
ConfigMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…