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

Function TestIssueRepoInfo_success

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

Source from the content-addressed store, hash-verified

230}
231
232func TestIssueRepoInfo_success(t *testing.T) {
233 httpReg := &httpmock.Registry{}
234 defer httpReg.Verify(t)
235
236 httpReg.Register(
237 httpmock.GraphQL(`query IssueRepositoryInfo\b`),
238 httpmock.StringResponse(`
239 { "data": { "repository": {
240 "id": "REPOID",
241 "name": "REPO",
242 "owner": {"login": "OWNER"},
243 "hasIssuesEnabled": true,
244 "viewerPermission": "WRITE"
245 } } }`))
246
247 client := newTestClient(httpReg)
248 repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO"))
249 require.NoError(t, err)
250 assert.Equal(t, &Repository{
251 ID: "REPOID",
252 Name: "REPO",
253 Owner: RepositoryOwner{Login: "OWNER"},
254 HasIssuesEnabled: true,
255 ViewerPermission: "WRITE",
256 hostname: "github.com",
257 }, repo)
258 assert.True(t, repo.ViewerCanTriage())
259}
260
261func TestIssueRepoInfo_issuesDisabled(t *testing.T) {
262 httpReg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 9

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
NewFunction · 0.92
newTestClientFunction · 0.85
IssueRepoInfoFunction · 0.85
EqualMethod · 0.80
ViewerCanTriageMethod · 0.80

Tested by

no test coverage detected