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

Function TestPRCheckout_maintainerCanModify

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

Source from the content-addressed store, hash-verified

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