MCPcopy Index your code
hub / github.com/cli/cli / TestIssueRepoInfo_issuesDisabled

Function TestIssueRepoInfo_issuesDisabled

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

Source from the content-addressed store, hash-verified

176}
177
178func TestIssueRepoInfo_issuesDisabled(t *testing.T) {
179 httpReg := &httpmock.Registry{}
180 defer httpReg.Verify(t)
181
182 httpReg.Register(
183 httpmock.GraphQL(`query IssueRepositoryInfo\b`),
184 httpmock.StringResponse(`
185 { "data": { "repository": {
186 "id": "REPOID",
187 "name": "REPO",
188 "owner": {"login": "OWNER"},
189 "hasIssuesEnabled": false,
190 "viewerPermission": "READ"
191 } } }`))
192
193 client := newTestClient(httpReg)
194 repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO"))
195 require.NoError(t, err)
196 assert.Equal(t, &Repository{
197 ID: "REPOID",
198 Name: "REPO",
199 Owner: RepositoryOwner{Login: "OWNER"},
200 ViewerPermission: "READ",
201 hostname: "github.com",
202 }, repo)
203 assert.False(t, repo.ViewerCanTriage())
204}
205
206func Test_RepoMetadata(t *testing.T) {
207 http := &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