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

Function TestCreateOrgPersistsHostnameAlias

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

Source from the content-addressed store, hash-verified

1375
1376 req := httptest.NewRequest(http.MethodPut, "/api/v1/orgs/analytics/warehouse", bytes.NewReader(body))
1377 req.Header.Set("Content-Type", "application/json")
1378 rec := httptest.NewRecorder()
1379 router.ServeHTTP(rec, req)
1380
1381 if rec.Code != http.StatusBadRequest {
1382 t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusBadRequest, rec.Body.String())
1383 }
1384}
1385
1386func TestPutWarehouseRejectsSecretRefsWithoutWorkerNamespace(t *testing.T) {
1387 store := newFakeAPIStore()
1388 store.orgs["analytics"] = &configstore.Org{Name: "analytics"}
1389 router := newTestAPIRouter(store)
1390
1391 body := []byte(`{
1392 "duckling_name": "analytics",
1393 "worker_identity": {
1394 "iam_role_arn": "arn:aws:iam::123456789012:role/analytics-worker"
1395 },
1396 "metadata_store_credentials": {
1397 "namespace": "tenant-b",
1398 "name": "analytics-metadata",
1399 "key": "dsn"
1400 }

Callers

nothing calls this directly

Calls 3

newFakeAPIStoreFunction · 0.85
newTestAPIRouterFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected