(t *testing.T)
| 467 | } |
| 468 | |
| 469 | func TestGetInfo(t *testing.T) { |
| 470 | srv := testServer(t) |
| 471 | resp, err := http.Get(srv.URL + "/v1/info") |
| 472 | if err != nil { |
| 473 | t.Fatal(err) |
| 474 | } |
| 475 | defer resp.Body.Close() |
| 476 | if resp.StatusCode != 200 { |
| 477 | t.Fatalf("status: %d", resp.StatusCode) |
| 478 | } |
| 479 | if resp.Header.Get("X-Request-Id") == "" { |
| 480 | t.Error("missing X-Request-Id header") |
| 481 | } |
| 482 | if resp.Header.Get("X-Content-Type-Options") != "nosniff" { |
| 483 | t.Error("missing nosniff header") |
| 484 | } |
| 485 | var body DeploymentInfoView |
| 486 | if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { |
| 487 | t.Fatal(err) |
| 488 | } |
| 489 | if body.SharedDomain != "agents.e2a.dev" || !body.SlugRegistrationEnabled || body.PublicURL != "https://api.e2a.dev" { |
| 490 | t.Fatalf("unexpected info: %+v", body) |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | func TestListAgentsAuthorized(t *testing.T) { |
| 495 | srv := testServer(t) |
nothing calls this directly
no test coverage detected