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

Function TestCreateAgentDuplicate

internal/identity/store_test.go:48–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestCreateAgentDuplicate(t *testing.T) {
49 pool := testutil.TestDB(t)
50 store := identity.NewStore(pool)
51 ctx := context.Background()
52
53 user, _ := store.CreateOrGetUser(ctx, "owner@example.com", "Owner", "google-dup-agent")
54 store.ClaimOrCreateDomain(ctx, "dup.example.com", user.ID)
55
56 store.CreateAgent(ctx, "agent@dup.example.com", "dup.example.com", "", "https://example.com/webhook", "", user.ID)
57 _, err := store.CreateAgent(ctx, "agent@dup.example.com", "dup.example.com", "", "https://example.com/webhook2", "", user.ID)
58 if err == nil {
59 t.Error("expected error for duplicate agent")
60 }
61}
62
63// TestClaimOrCreateDomain_StableOnReclaim asserts that re-claiming an
64// unverified domain returns the row unchanged: the verification_token

Callers

nothing calls this directly

Calls 6

CreateOrGetUserMethod · 0.95
ClaimOrCreateDomainMethod · 0.95
CreateAgentMethod · 0.95
TestDBFunction · 0.92
NewStoreFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected