(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func 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 | |
| 24 | func TestGetMyLimitsUnauthorized(t *testing.T) { |
| 25 | srv := testServer(t) |
nothing calls this directly
no test coverage detected