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

Function TestUpdateOrgMaxVCPUsCanClearToZero

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

Source from the content-addressed store, hash-verified

1593 req := httptest.NewRequest(http.MethodPut, "/api/v1/orgs/analytics/warehouse", bytes.NewReader(body))
1594 req.Header.Set("Content-Type", "application/json")
1595 rec := httptest.NewRecorder()
1596 router.ServeHTTP(rec, req)
1597
1598 if rec.Code != http.StatusBadRequest {
1599 t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusBadRequest, rec.Body.String())
1600 }
1601 if _, ok := store.warehouses["analytics"]; ok {
1602 t.Fatal("expected invalid warehouse payload to be rejected")
1603 }
1604}
1605
1606func TestPutWarehouseRejectsSecretReferenceWithoutOrgPrefix(t *testing.T) {
1607 store := newFakeAPIStore()
1608 store.orgs["analytics"] = &configstore.Org{Name: "analytics"}
1609 router := newTestAPIRouter(store)
1610
1611 body := []byte(`{
1612 "duckling_name": "analytics",
1613 "worker_identity": {
1614 "namespace": "tenant-a"
1615 },
1616 "metadata_store_credentials": {
1617 "namespace": "tenant-a",
1618 "name": "shared-analytics-metadata",
1619 "key": "dsn"
1620 }
1621 }`)

Callers

nothing calls this directly

Calls 3

newFakeAPIStoreFunction · 0.85
newTestAPIRouterFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected