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

Function TestGetMyLimits

internal/httpapi/account_test.go:5–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestGetMyLimits(t *testing.T) {
6 srv := testServer(t)
7 code, body := getJSON(t, srv.URL+"/v1/account", "good")
8 if code != 200 {
9 t.Fatalf("status %d body %v", code, body)
10 }
11 if body["plan_code"] != "pro" {
12 t.Fatalf("unexpected plan: %v", body)
13 }
14 caps, _ := body["limits"].(map[string]any)
15 if caps["max_agents"].(float64) != 10 {
16 t.Fatalf("unexpected caps: %v", caps)
17 }
18 usage, _ := body["usage"].(map[string]any)
19 if usage["agents"].(float64) != 2 || usage["messages_month"].(float64) != 42 {
20 t.Fatalf("unexpected usage: %v", usage)
21 }
22}
23
24func TestGetMyLimitsUnauthorized(t *testing.T) {
25 srv := testServer(t)

Callers

nothing calls this directly

Calls 2

testServerFunction · 0.85
getJSONFunction · 0.85

Tested by

no test coverage detected