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

Function TestProcessAttachment_PNG_Passthrough

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

Source from the content-addressed store, hash-verified

94}
95
96func TestProcessAttachment_PNG_Passthrough(t *testing.T) {
97 t.Parallel()
98 data := encodePNGBytes(100, 100, false)
99 path := writeTempFile(t, ".png", data)
100
101 doc, err := chat.ProcessAttachment(t.Context(), chat.MessagePart{
102 Type: chat.MessagePartTypeFile,
103 File: &chat.MessageFile{Path: path, MimeType: "image/png"},
104 })
105 require.NoError(t, err)
106 assert.Equal(t, "image/png", doc.MimeType)
107 assert.NotEmpty(t, doc.Source.InlineData)
108}
109
110func TestProcessAttachment_PNG_WithAlpha_StaysPNG(t *testing.T) {
111 t.Parallel()

Callers

nothing calls this directly

Calls 4

ProcessAttachmentFunction · 0.92
encodePNGBytesFunction · 0.85
ContextMethod · 0.80
writeTempFileFunction · 0.70

Tested by

no test coverage detected