MCPcopy
hub / github.com/helm/helm / startLocalServerForTests

Function startLocalServerForTests

pkg/action/pull_test.go:66–80  ·  view source on GitHub ↗
(t *testing.T, handler http.Handler)

Source from the content-addressed store, hash-verified

64}
65
66func startLocalServerForTests(t *testing.T, handler http.Handler) (*httptest.Server, error) {
67 t.Helper()
68 if handler == nil {
69 fileBytes, err := os.ReadFile("../repo/v1/testdata/local-index.yaml")
70 if err != nil {
71 return nil, err
72 }
73 handler = http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
74 _, err = w.Write(fileBytes)
75 require.NoError(t, err)
76 })
77 }
78
79 return httptest.NewServer(handler), nil
80}

Callers 1

Calls 2

HelperMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…