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

Function TestCreateOrgAcceptsDefaultWorkerProfile

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

Source from the content-addressed store, hash-verified

1868 }
1869 got := store.warehouses["analytics"]
1870 if got.Image != "new-image:2.0" {
1871 t.Errorf("image = %q, want new-image:2.0", got.Image)
1872 }
1873 if got.DuckLakeVersion != "0.4" {
1874 t.Errorf("ducklake_version = %q, want 0.4 (untouched)", got.DuckLakeVersion)
1875 }
1876}
1877
1878func TestPatchTenantPinningEmptyStringClearsField(t *testing.T) {
1879 store := newFakeAPIStore()
1880 store.orgs["analytics"] = &configstore.Org{Name: "analytics"}
1881 store.warehouses["analytics"] = &configstore.ManagedWarehouse{
1882 OrgID: "analytics",
1883 Image: "pinned:1.0",
1884 DuckLakeVersion: "0.4",
1885 }
1886 router := newTestAPIRouter(store)
1887
1888 // Explicit "" — distinct from absent — falls back to global default.
1889 body := []byte(`{"image":""}`)
1890 req := httptest.NewRequest(http.MethodPatch, "/api/v1/orgs/analytics/warehouse/pinning", bytes.NewReader(body))
1891 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