MCPcopy
hub / github.com/cli/cli / TestPRCheckout_maintainerCanModify

Function TestPRCheckout_maintainerCanModify

pkg/cmd/pr/checkout/checkout_test.go:708–729  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

706}
707
708func TestPRCheckout_maintainerCanModify(t *testing.T) {
709 http := &httpmock.Registry{}
710 defer http.Verify(t)
711
712 baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature")
713 pr.MaintainerCanModify = true
714 shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo)
715
716 cs, cmdTeardown := run.Stub()
717 defer cmdTeardown(t)
718 cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "")
719 cs.Register(`git config branch\.feature\.merge`, 1, "")
720 cs.Register(`git checkout feature`, 0, "")
721 cs.Register(`git config branch\.feature\.remote https://github\.com/hubot/REPO\.git`, 0, "")
722 cs.Register(`git config branch\.feature\.pushRemote https://github\.com/hubot/REPO\.git`, 0, "")
723 cs.Register(`git config branch\.feature\.merge refs/heads/feature`, 0, "")
724
725 output, err := runCommand(http, nil, "master", `123`, baseRepo)
726 assert.NoError(t, err)
727 assert.Equal(t, "", output.String())
728 assert.Equal(t, "", output.Stderr())
729}
730
731func TestPRCheckout_recurseSubmodules(t *testing.T) {
732 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 9

VerifyMethod · 0.95
StubFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
stubPRFunction · 0.70
runCommandFunction · 0.70
RegisterMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected