MCPcopy
hub / github.com/cli/cli / TestGitHubRepo_notFound

Function TestGitHubRepo_notFound

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

Source from the content-addressed store, hash-verified

17)
18
19func TestGitHubRepo_notFound(t *testing.T) {
20 httpReg := &httpmock.Registry{}
21 defer httpReg.Verify(t)
22
23 httpReg.Register(
24 httpmock.GraphQL(`query RepositoryInfo\b`),
25 httpmock.StringResponse(`{ "data": { "repository": null } }`))
26
27 client := newTestClient(httpReg)
28 repo, err := GitHubRepo(client, ghrepo.New("OWNER", "REPO"))
29 require.EqualError(t, err, "GraphQL: Could not resolve to a Repository with the name 'OWNER/REPO'.")
30 assert.Nil(t, repo)
31}
32
33func TestGitHubRepo_success(t *testing.T) {
34 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
GitHubRepoFunction · 0.85

Tested by

no test coverage detected