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

Function TestUpdateOrgSetsDefaultWorkerMinHotIdle

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

Source from the content-addressed store, hash-verified

1769
1770func TestGetOrgOmitsMaxConnections(t *testing.T) {
1771 store := newFakeAPIStore()
1772 store.orgs["analytics"] = &configstore.Org{
1773 Name: "analytics",
1774 }
1775 router := newTestAPIRouter(store)
1776
1777 req := httptest.NewRequest(http.MethodGet, "/api/v1/orgs/analytics", nil)
1778 rec := httptest.NewRecorder()
1779 router.ServeHTTP(rec, req)
1780
1781 if rec.Code != http.StatusOK {
1782 t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusOK, rec.Body.String())
1783 }
1784 if bytes.Contains(rec.Body.Bytes(), []byte(`"max_connections"`)) {
1785 t.Fatalf("expected org response to omit max_connections, got %s", rec.Body.String())
1786 }
1787}
1788
1789func TestManagedWarehouseUpsertColumnsExcludeCreatedAt(t *testing.T) {
1790 columns := managedWarehouseUpsertColumns()
1791
1792 if slices.Contains(columns, "created_at") {
1793 t.Fatal("expected created_at to be excluded from managed warehouse upserts")
1794 }
1795 if slices.Contains(columns, "org_id") {
1796 t.Fatal("expected org_id to be excluded from managed warehouse upserts")
1797 }
1798 if !slices.Contains(columns, "updated_at") {
1799 t.Fatal("expected updated_at to be included in managed warehouse upserts")

Callers

nothing calls this directly

Calls 3

newFakeAPIStoreFunction · 0.85
newTestAPIRouterFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected