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

Function TestModifyMessageLabels_WrongAgent

internal/identity/labels_test.go:142–155  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestModifyMessageLabels_WrongAgent(t *testing.T) {
143 pool := testutil.TestDB(t)
144 store := identity.NewStore(pool)
145 ctx := context.Background()
146
147 msgID, _ := labelsTestSetup(t, store, "labels-wrong-a")
148 _, otherAgentID := labelsTestSetup(t, store, "labels-wrong-b")
149
150 // agent B's id must NOT be able to mutate agent A's message.
151 _, err := store.ModifyMessageLabels(ctx, msgID, otherAgentID, []string{"x"}, nil)
152 if !errors.Is(err, identity.ErrMessageNotFound) {
153 t.Errorf("err = %v, want ErrMessageNotFound (cross-agent must look like not-found)", err)
154 }
155}
156
157func TestGetMessagesByAgent_LabelsFilterANDMatch(t *testing.T) {
158 pool := testutil.TestDB(t)

Callers

nothing calls this directly

Calls 4

ModifyMessageLabelsMethod · 0.95
TestDBFunction · 0.92
NewStoreFunction · 0.92
labelsTestSetupFunction · 0.85

Tested by

no test coverage detected