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

Function TestIssueView_web_notFound

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

Source from the content-addressed store, hash-verified

329}
330
331func TestIssueView_web_notFound(t *testing.T) {
332 http := &httpmock.Registry{}
333 defer http.Verify(t)
334
335 http.Register(
336 httpmock.GraphQL(`query IssueByNumber\b`),
337 httpmock.StringResponse(`
338 { "errors": [
339 { "message": "Could not resolve to an Issue with the number of 9999." }
340 ] }
341 `),
342 )
343
344 _, cmdTeardown := run.Stub()
345 defer cmdTeardown(t)
346
347 _, err := runCommand(http, true, "-w 9999")
348 if err == nil || err.Error() != "GraphQL: Could not resolve to an Issue with the number of 9999." {
349 t.Errorf("error running command `issue view`: %v", err)
350 }
351}
352
353func TestIssueView_disabledIssues(t *testing.T) {
354 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