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

Function getJSON

controlplane/admin/cluster_test.go:33–46  ·  view source on GitHub ↗
(t *testing.T, e *gin.Engine, path string)

Source from the content-addressed store, hash-verified

31}
32
33func getJSON(t *testing.T, e *gin.Engine, path string) map[string]any {
34 t.Helper()
35 w := httptest.NewRecorder()
36 req := httptest.NewRequest(http.MethodGet, path, nil)
37 e.ServeHTTP(w, req)
38 if w.Code != http.StatusOK {
39 t.Fatalf("GET %s = %d, want 200 (%s)", path, w.Code, w.Body.String())
40 }
41 var out map[string]any
42 if err := json.Unmarshal(w.Body.Bytes(), &out); err != nil {
43 t.Fatalf("GET %s: bad json: %v", path, err)
44 }
45 return out
46}
47
48func TestClusterNodesProjection(t *testing.T) {
49 node := &corev1.Node{

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected