MCPcopy
hub / github.com/cli/cli / TestIssueDelete_doesNotExist

Function TestIssueDelete_doesNotExist

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

Source from the content-addressed store, hash-verified

159}
160
161func TestIssueDelete_doesNotExist(t *testing.T) {
162 httpRegistry := &httpmock.Registry{}
163 defer httpRegistry.Verify(t)
164
165 httpRegistry.Register(
166 httpmock.GraphQL(`query IssueByNumber\b`),
167 httpmock.StringResponse(`
168 { "errors": [
169 { "message": "Could not resolve to an Issue with the number of 13." }
170 ] }
171 `),
172 )
173
174 _, err := runCommand(httpRegistry, nil, true, "13")
175 if err == nil || err.Error() != "GraphQL: Could not resolve to an Issue with the number of 13." {
176 t.Errorf("error running command `issue delete`: %v", err)
177 }
178}
179
180func TestIssueDelete_issuesDisabled(t *testing.T) {
181 httpRegistry := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected