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

Function TestUpdateUserRejectsNegativeMaxVCPUs

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

Source from the content-addressed store, hash-verified

444 IdentityState: configstore.ManagedWarehouseStateReady,
445 SecretsState: configstore.ManagedWarehouseStateReady,
446 }
447 store.orgs[name] = &configstore.Org{
448 Name: name,
449 Warehouse: copyWarehouse(warehouse),
450 }
451 store.warehouses[name] = warehouse
452}
453
454func TestCreateUserIgnoresRemovedDefaultCatalogField(t *testing.T) {
455 // default_catalog was removed with Iceberg support. The users endpoints do
456 // not reject unknown JSON fields, so a legacy body carrying it still
457 // creates the user — the field is just silently ignored.
458 store := newFakeAPIStore()
459 router := newTestAPIRouter(store)
460
461 body := []byte(`{
462 "org_id": "analytics",
463 "username": "reader",
464 "password": "secret",
465 "default_catalog": "iceberg"
466 }`)
467 req := httptest.NewRequest(http.MethodPost, "/api/v1/users", bytes.NewReader(body))
468 req.Header.Set("Content-Type", "application/json")
469 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