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

Function TestHandler_InvalidToken

internal/ws/handler_test.go:173–185  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

171}
172
173func TestHandler_InvalidToken(t *testing.T) {
174 hub := NewHub()
175 defer hub.Close()
176 store := &mockStore{user: nil, userErr: fmt.Errorf("not found")}
177 handler := NewHandler(hub, store)
178 srv := startServer(t, handler)
179
180 resp := doHTTP(t, srv, "bot@agents.e2a.dev", "bad_key")
181 defer resp.Body.Close()
182 if resp.StatusCode != http.StatusUnauthorized {
183 t.Fatalf("expected 401, got %d", resp.StatusCode)
184 }
185}
186
187func TestHandler_AgentNotFound(t *testing.T) {
188 hub := NewHub()

Callers

nothing calls this directly

Calls 5

CloseMethod · 0.95
NewHubFunction · 0.85
NewHandlerFunction · 0.85
startServerFunction · 0.85
doHTTPFunction · 0.85

Tested by

no test coverage detected