MCPcopy
hub / github.com/docker/docker-agent / TestProcessAttachment_TextFile_InlineText

Function TestProcessAttachment_TextFile_InlineText

pkg/chat/attach_test.go:176–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestProcessAttachment_TextFile_InlineText(t *testing.T) {
177 t.Parallel()
178 content := "Hello, this is a text file.\nLine 2."
179 path := writeTempFile(t, ".txt", []byte(content))
180
181 doc, err := chat.ProcessAttachment(t.Context(), chat.MessagePart{
182 Type: chat.MessagePartTypeFile,
183 File: &chat.MessageFile{Path: path, MimeType: "text/plain"},
184 })
185 require.NoError(t, err)
186 assert.Empty(t, doc.Source.InlineData)
187 assert.Contains(t, doc.Source.InlineText, content)
188}
189
190func TestProcessAttachment_MarkdownFile_InlineText(t *testing.T) {
191 t.Parallel()

Callers

nothing calls this directly

Calls 3

ProcessAttachmentFunction · 0.92
ContextMethod · 0.80
writeTempFileFunction · 0.70

Tested by

no test coverage detected