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

Function TestCreateAgentUnregisteredDomain

internal/httpapi/agents_write_test.go:128–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestCreateAgentUnregisteredDomain(t *testing.T) {
129 srv := testServer(t)
130 // The security-critical guard: an agent cannot be created on a domain
131 // the caller has not registered + verified.
132 code, body := postJSON(t, srv.URL+"/v1/agents", "good", map[string]any{
133 "email": "bot@someone-elses.com",
134 })
135 if code != 400 || errCode(body) != "domain_not_registered" {
136 t.Fatalf("want 400 domain_not_registered, got %d %v", code, body)
137 }
138}
139
140func TestCreateAgentDuplicate(t *testing.T) {
141 srv := testServer(t)

Callers

nothing calls this directly

Calls 3

testServerFunction · 0.85
postJSONFunction · 0.85
errCodeFunction · 0.85

Tested by

no test coverage detected