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

Function TestIssueView_web_notFound

pkg/cmd/issue/view/view_test.go:343–363  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

341}
342
343func TestIssueView_web_notFound(t *testing.T) {
344 http := &httpmock.Registry{}
345 defer http.Verify(t)
346
347 http.Register(
348 httpmock.GraphQL(`query IssueByNumber\b`),
349 httpmock.StringResponse(`
350 { "errors": [
351 { "message": "Could not resolve to an Issue with the number of 9999." }
352 ] }
353 `),
354 )
355
356 _, cmdTeardown := run.Stub()
357 defer cmdTeardown(t)
358
359 _, err := runCommand(http, true, "-w 9999")
360 if err == nil || err.Error() != "GraphQL: Could not resolve to an Issue with the number of 9999." {
361 t.Errorf("error running command `issue view`: %v", err)
362 }
363}
364
365func TestIssueView_disabledIssues(t *testing.T) {
366 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected