MCPcopy Index your code
hub / github.com/docker/docker-agent / TestReadFileForInline

Function TestReadFileForInline

pkg/chat/chat_test.go:142–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestReadFileForInline(t *testing.T) {
143 t.Parallel()
144 tmpDir := t.TempDir()
145
146 testFile := filepath.Join(tmpDir, "example.go")
147 content := "package main\n\nfunc main() {}\n"
148 err := os.WriteFile(testFile, []byte(content), 0o644)
149 require.NoError(t, err)
150
151 result, err := ReadFileForInline(testFile)
152 require.NoError(t, err)
153
154 assert.Contains(t, result, `<attached_file path="`+testFile+`">`)
155 assert.Contains(t, result, content)
156 assert.Contains(t, result, `</attached_file>`)
157}
158
159func TestReadFileForInline_NotFound(t *testing.T) {
160 t.Parallel()

Callers

nothing calls this directly

Calls 1

ReadFileForInlineFunction · 0.85

Tested by

no test coverage detected