(t *testing.T)
| 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 | |
| 1878 | func 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() |
nothing calls this directly
no test coverage detected