MCPcopy Create free account
hub / github.com/cli/cli / TestPRCheckout_maintainerCanModify

Function TestPRCheckout_maintainerCanModify

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

Source from the content-addressed store, hash-verified

1099}
1100
1101func TestPRCheckout_maintainerCanModify(t *testing.T) {
1102 http := &httpmock.Registry{}
1103 defer http.Verify(t)
1104
1105 baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature")
1106 pr.MaintainerCanModify = true
1107 shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo)
1108
1109 cs, cmdTeardown := run.Stub()
1110 defer cmdTeardown(t)
1111 cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "")
1112 cs.Register(`git config branch\.feature\.merge`, 1, "")
1113 cs.Register(`git checkout feature`, 0, "")
1114 cs.Register(`git config branch\.feature\.remote https://github\.com/hubot/REPO\.git`, 0, "")
1115 cs.Register(`git config branch\.feature\.pushRemote https://github\.com/hubot/REPO\.git`, 0, "")
1116 cs.Register(`git config branch\.feature\.merge refs/heads/feature`, 0, "")
1117
1118 output, err := runCommand(http, nil, "master", `123`, baseRepo)
1119 assert.NoError(t, err)
1120 assert.Equal(t, "", output.String())
1121 assert.Equal(t, "", output.Stderr())
1122}
1123
1124func TestPRCheckout_recurseSubmodules(t *testing.T) {
1125 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
StringMethod · 0.65
RegisterMethod · 0.45

Tested by

no test coverage detected