MCPcopy
hub / github.com/cli/cli / TestIssueReopen_issuesDisabled

Function TestIssueReopen_issuesDisabled

pkg/cmd/issue/reopen/reopen_test.go:122–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestIssueReopen_issuesDisabled(t *testing.T) {
123 http := &httpmock.Registry{}
124 defer http.Verify(t)
125
126 http.Register(
127 httpmock.GraphQL(`query IssueByNumber\b`),
128 httpmock.StringResponse(`
129 {
130 "data": {
131 "repository": {
132 "hasIssuesEnabled": false,
133 "issue": null
134 }
135 },
136 "errors": [
137 {
138 "type": "NOT_FOUND",
139 "path": [
140 "repository",
141 "issue"
142 ],
143 "message": "Could not resolve to an issue or pull request with the number of 2."
144 }
145 ]
146 }`),
147 )
148
149 _, err := runCommand(http, true, "2")
150 if err == nil || err.Error() != "the 'OWNER/REPO' repository has disabled issues" {
151 t.Fatalf("got error: %v", err)
152 }
153}
154
155func TestIssueReopen_withComment(t *testing.T) {
156 http := &httpmock.Registry{}

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