MCPcopy
hub / github.com/cli/cli / NewTestClient

Function NewTestClient

pkg/cmd/project/shared/queries/queries.go:40–56  ·  view source on GitHub ↗
(opts ...TestClientOpt)

Source from the content-addressed store, hash-verified

38}
39
40func NewTestClient(opts ...TestClientOpt) *Client {
41 apiClient := &hostScopedClient{
42 hostname: "github.com",
43 Client: api.NewClientFromHTTP(http.DefaultClient),
44 }
45 io, _, _, _ := iostreams.Test()
46 c := &Client{
47 apiClient: apiClient,
48 io: io,
49 prompter: nil,
50 }
51
52 for _, o := range opts {
53 o(c)
54 }
55 return c
56}
57
58type iprompter interface {
59 Select(string, string, []string) (int, error)

Callers 15

TestRunClose_UserFunction · 0.92
TestRunClose_OrgFunction · 0.92
TestRunClose_MeFunction · 0.92
TestRunClose_ReopenFunction · 0.92
TestRunClose_JSONFunction · 0.92
TestRunLink_RepoFunction · 0.92
TestRunLink_TeamFunction · 0.92
TestRunCopy_UserFunction · 0.92
TestRunCopy_OrgFunction · 0.92
TestRunCopy_MeFunction · 0.92
TestRunCopy_JSONFunction · 0.92
TestRunMarkTemplate_OrgFunction · 0.92

Calls 2

NewClientFromHTTPFunction · 0.92
TestFunction · 0.92

Tested by 15

TestRunClose_UserFunction · 0.74
TestRunClose_OrgFunction · 0.74
TestRunClose_MeFunction · 0.74
TestRunClose_ReopenFunction · 0.74
TestRunClose_JSONFunction · 0.74
TestRunLink_RepoFunction · 0.74
TestRunLink_TeamFunction · 0.74
TestRunCopy_UserFunction · 0.74
TestRunCopy_OrgFunction · 0.74
TestRunCopy_MeFunction · 0.74
TestRunCopy_JSONFunction · 0.74
TestRunMarkTemplate_OrgFunction · 0.74