MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestUpdateOrgOmittingMaxVCPUsPreservesIt

Function TestUpdateOrgOmittingMaxVCPUsPreservesIt

controlplane/admin/api_test.go:1620–1643  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1618 "name": "shared-analytics-metadata",
1619 "key": "dsn"
1620 }
1621 }`)
1622
1623 req := httptest.NewRequest(http.MethodPut, "/api/v1/orgs/analytics/warehouse", bytes.NewReader(body))
1624 req.Header.Set("Content-Type", "application/json")
1625 rec := httptest.NewRecorder()
1626 router.ServeHTTP(rec, req)
1627
1628 if rec.Code != http.StatusBadRequest {
1629 t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusBadRequest, rec.Body.String())
1630 }
1631 if !strings.Contains(rec.Body.String(), "must start with") {
1632 t.Fatalf("expected org prefix validation error, got %s", rec.Body.String())
1633 }
1634}
1635
1636func TestCreateOrgRejectsNestedWarehousePayload(t *testing.T) {
1637 store := newFakeAPIStore()
1638 router := newTestAPIRouter(store)
1639
1640 body := []byte(`{
1641 "name": "analytics",
1642 "max_workers": 4,
1643 "warehouse": {
1644 "state": "ready"
1645 }
1646 }`)

Callers

nothing calls this directly

Calls 3

newFakeAPIStoreFunction · 0.85
newTestAPIRouterFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected