MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestUpdateMessageLabels_AddRemove

Function TestUpdateMessageLabels_AddRemove

internal/httpapi/messages_labels_test.go:48–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestUpdateMessageLabels_AddRemove(t *testing.T) {
49 srv := httptest.NewServer(New(labelDeps()))
50 t.Cleanup(srv.Close)
51 code, body := sendJSON(t, "PATCH", srv.URL+"/v1/agents/support%40acme.com/messages/msg_a", "good", map[string]any{
52 "add_labels": []string{"urgent", "vip"},
53 })
54 if code != 200 {
55 t.Fatalf("status %d body %v", code, body)
56 }
57 if body["message_id"] != "msg_a" {
58 t.Fatalf("message_id = %v, want msg_a", body["message_id"])
59 }
60 labels, _ := body["labels"].([]any)
61 if len(labels) != 2 || labels[0] != "urgent" {
62 t.Fatalf("labels = %v, want [urgent vip]", body["labels"])
63 }
64}
65
66func TestUpdateMessageLabels_CapExceededIs400(t *testing.T) {
67 srv := httptest.NewServer(New(labelDeps()))

Callers

nothing calls this directly

Calls 4

labelDepsFunction · 0.85
sendJSONFunction · 0.85
CleanupMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected