MCPcopy
hub / github.com/cli/cli / TestIssueStatus_disabledIssues

Function TestIssueStatus_disabledIssues

pkg/cmd/issue/status/status_test.go:129–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

127}
128
129func TestIssueStatus_disabledIssues(t *testing.T) {
130 http := &httpmock.Registry{}
131 defer http.Verify(t)
132
133 http.Register(
134 httpmock.GraphQL(`query UserCurrent\b`),
135 httpmock.StringResponse(`{"data":{"viewer":{"login":"octocat"}}}`))
136 http.Register(
137 httpmock.GraphQL(`query IssueStatus\b`),
138 httpmock.StringResponse(`
139 { "data": { "repository": {
140 "hasIssuesEnabled": false
141 } } }`))
142
143 _, err := runCommand(http, true, "")
144 if err == nil || err.Error() != "the 'OWNER/REPO' repository has disabled issues" {
145 t.Errorf("error running command `issue status`: %v", err)
146 }
147}

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