MCPcopy Create free account
hub / github.com/cli/cli / newTestClient

Function newTestClient

pkg/cmd/event/client/client_test.go:41–45  ·  view source on GitHub ↗
(t *testing.T, host string)

Source from the content-addressed store, hash-verified

39}
40
41func newTestClient(t *testing.T, host string) (EventClient, *httpmock.Registry) {
42 reg := &httpmock.Registry{}
43 t.Cleanup(func() { reg.Verify(t) })
44 return NewEventClient(&http.Client{Transport: reg}, host), reg
45}
46
47func errorResponse(status int, message string) httpmock.Responder {
48 return httpmock.StatusJSONResponse(status, map[string]string{"message": message})

Callers 9

TestCreateSubscriptionFunction · 0.70
TestGetSubscriptionFunction · 0.70
TestListSubscriptionsFunction · 0.70
TestDeleteSubscriptionFunction · 0.70
TestClientErrorsFunction · 0.70
TestOpenStreamFunction · 0.70

Calls 2

VerifyMethod · 0.95
NewEventClientFunction · 0.85

Tested by

no test coverage detected