MCPcopy
hub / github.com/cli/cli / TestPrClose_alreadyClosed

Function TestPrClose_alreadyClosed

pkg/cmd/pr/close/close_test.go:129–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

127}
128
129func TestPrClose_alreadyClosed(t *testing.T) {
130 http := &httpmock.Registry{}
131 defer http.Verify(t)
132
133 baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature")
134 pr.State = "CLOSED"
135 pr.Title = "The title of the PR"
136 shared.StubFinderForRunCommandStyleTests(t, "96", pr, baseRepo)
137
138 output, err := runCommand(http, true, "96")
139 assert.NoError(t, err)
140 assert.Equal(t, "", output.String())
141 assert.Equal(t, "! Pull request OWNER/REPO#96 (The title of the PR) is already closed\n", output.Stderr())
142}
143
144func TestPrClose_deleteBranch_sameRepo(t *testing.T) {
145 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
EqualMethod · 0.80
StderrMethod · 0.80
stubPRFunction · 0.70
runCommandFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected