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

Function NewTestClient

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

Source from the content-addressed store, hash-verified

39}
40
41func NewTestClient(opts ...TestClientOpt) *Client {
42 apiClient := &hostScopedClient{
43 hostname: "github.com",
44 Client: api.NewClientFromHTTP(http.DefaultClient),
45 }
46 io, _, _, _ := iostreams.Test()
47 c := &Client{
48 apiClient: apiClient,
49 io: io,
50 prompter: nil,
51 }
52
53 for _, o := range opts {
54 o(c)
55 }
56 return c
57}
58
59type iprompter interface {
60 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