MCPcopy
hub / github.com/cli/cli / TestIssueDelete_issuesDisabled

Function TestIssueDelete_issuesDisabled

pkg/cmd/issue/delete/delete_test.go:180–211  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

178}
179
180func TestIssueDelete_issuesDisabled(t *testing.T) {
181 httpRegistry := &httpmock.Registry{}
182 defer httpRegistry.Verify(t)
183
184 httpRegistry.Register(
185 httpmock.GraphQL(`query IssueByNumber\b`),
186 httpmock.StringResponse(`
187 {
188 "data": {
189 "repository": {
190 "hasIssuesEnabled": false,
191 "issue": null
192 }
193 },
194 "errors": [
195 {
196 "type": "NOT_FOUND",
197 "path": [
198 "repository",
199 "issue"
200 ],
201 "message": "Could not resolve to an issue or pull request with the number of 13."
202 }
203 ]
204 }`),
205 )
206
207 _, err := runCommand(httpRegistry, nil, true, "13")
208 if err == nil || err.Error() != "the 'OWNER/REPO' repository has disabled issues" {
209 t.Fatalf("got error: %v", err)
210 }
211}

Callers

nothing calls this directly

Calls 6

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
runCommandFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected