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

Function TestPRReadyUndo_alreadyDraft

pkg/cmd/pr/ready/ready_test.go:190–205  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestPRReadyUndo_alreadyDraft(t *testing.T) {
191 http := &httpmock.Registry{}
192 defer http.Verify(t)
193
194 shared.StubFinderForRunCommandStyleTests(t, "123", &api.PullRequest{
195 ID: "THE-ID",
196 Number: 123,
197 State: "OPEN",
198 IsDraft: true,
199 }, ghrepo.New("OWNER", "REPO"))
200
201 output, err := runCommand(http, true, "123 --undo")
202 assert.NoError(t, err)
203 assert.Equal(t, "", output.String())
204 assert.Equal(t, "! Pull request OWNER/REPO#123 is already \"in draft\"\n", output.Stderr())
205}
206
207func TestPRReady_closed(t *testing.T) {
208 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
NewFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
runCommandFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected