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

Function TestUpdateOrgRejectsNegativeMaxVCPUs

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

Source from the content-addressed store, hash-verified

1668 "warehouse": {
1669 "state": "ready"
1670 }
1671 }`)
1672
1673 req := httptest.NewRequest(http.MethodPut, "/api/v1/orgs/analytics", bytes.NewReader(body))
1674 req.Header.Set("Content-Type", "application/json")
1675 rec := httptest.NewRecorder()
1676 router.ServeHTTP(rec, req)
1677
1678 if rec.Code != http.StatusBadRequest {
1679 t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusBadRequest, rec.Body.String())
1680 }
1681 if store.orgs["analytics"].MaxWorkers != 2 {
1682 t.Fatalf("expected org update to be rejected, max_workers = %d", store.orgs["analytics"].MaxWorkers)
1683 }
1684}
1685
1686func TestDeleteOrgRejectsWhenWarehouseStillExists(t *testing.T) {
1687 store := newFakeAPIStore()
1688 seedOrgWithWarehouse(store, "analytics")
1689 router := newTestAPIRouter(store)
1690
1691 req := httptest.NewRequest(http.MethodDelete, "/api/v1/orgs/analytics", nil)
1692 rec := httptest.NewRecorder()

Callers

nothing calls this directly

Calls 3

newFakeAPIStoreFunction · 0.85
newTestAPIRouterFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected