MCPcopy Create free account
hub / github.com/docker/docker-agent / TestFixingQueue_WithParts

Function TestFixingQueue_WithParts

pkg/a2a/executor_wrapper_test.go:65–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestFixingQueue_WithParts(t *testing.T) {
66 t.Parallel()
67 mock := &mockQueue{}
68 fq := &fixingQueue{queue: mock}
69
70 // Create an artifact update event with actual parts
71 event := &a2a.TaskArtifactUpdateEvent{
72 ContextID: "test-context",
73 TaskID: "test-task",
74 Append: true,
75 Artifact: &a2a.Artifact{
76 ID: "test-artifact",
77 Parts: []a2a.Part{
78 a2a.TextPart{Text: "Hello"},
79 },
80 },
81 }
82
83 // Write the event through the fixing queue
84 err := fq.Write(t.Context(), event)
85 require.NoError(t, err)
86
87 // Verify the event was written unchanged
88 require.Len(t, mock.events, 1)
89 written := mock.events[0].(*a2a.TaskArtifactUpdateEvent)
90
91 assert.Len(t, written.Artifact.Parts, 1)
92}
93
94func TestFixingQueue_NonArtifactEvent(t *testing.T) {
95 t.Parallel()

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.95
ContextMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected