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

Function startServer

internal/ws/handler_test.go:65–72  ·  view source on GitHub ↗

startServer creates an httptest server with the WS handler mounted on a mux router.

(t *testing.T, handler *Handler)

Source from the content-addressed store, hash-verified

63
64// startServer creates an httptest server with the WS handler mounted on a mux router.
65func startServer(t *testing.T, handler *Handler) *httptest.Server {
66 t.Helper()
67 r := mux.NewRouter()
68 r.HandleFunc("/api/v1/agents/{email}/ws", handler.Handle)
69 srv := httptest.NewServer(r)
70 t.Cleanup(srv.Close)
71 return srv
72}
73
74// dialWSPath connects to a specific WS path on the test server, authenticating
75// with the Authorization: Bearer header (the credential is never in the URL).

Calls 1

CleanupMethod · 0.80

Tested by

no test coverage detected