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

Function TestIssueRepoInfo_notFound

api/queries_repo_test.go:229–241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestIssueRepoInfo_notFound(t *testing.T) {
230 httpReg := &httpmock.Registry{}
231 defer httpReg.Verify(t)
232
233 httpReg.Register(
234 httpmock.GraphQL(`query IssueRepositoryInfo\b`),
235 httpmock.StringResponse(`{ "data": { "repository": null } }`))
236
237 client := newTestClient(httpReg)
238 repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO"))
239 require.EqualError(t, err, "GraphQL: Could not resolve to a Repository with the name 'OWNER/REPO'.")
240 assert.Nil(t, repo)
241}
242
243func TestIssueRepoInfo_success(t *testing.T) {
244 httpReg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
NewFunction · 0.92
newTestClientFunction · 0.85
IssueRepoInfoFunction · 0.85

Tested by

no test coverage detected