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

Function TestHealthEndpoint

internal/agent/api_test.go:70–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestHealthEndpoint(t *testing.T) {
71 server, _, _ := setupAPI(t)
72 resp, err := http.Get(server.URL + "/api/health")
73 if err != nil {
74 t.Fatal(err)
75 }
76 defer resp.Body.Close()
77
78 if resp.StatusCode != 200 {
79 t.Errorf("status = %d, want 200", resp.StatusCode)
80 }
81 var body map[string]string
82 json.NewDecoder(resp.Body).Decode(&body)
83 if body["status"] != "ok" {
84 t.Errorf("status = %q, want ok", body["status"])
85 }
86}
87
88func setupAPIWithSMTP(t *testing.T) (*httptest.Server, *identity.Store, *pgxpool.Pool, func() []testutil.SMTPMessage) {
89 t.Helper()

Callers

nothing calls this directly

Calls 3

setupAPIFunction · 0.85
GetMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected