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

Function TestPRCheckout_differentRepo_existingBranch

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

Source from the content-addressed store, hash-verified

1027}
1028
1029func TestPRCheckout_differentRepo_existingBranch(t *testing.T) {
1030 http := &httpmock.Registry{}
1031 defer http.Verify(t)
1032
1033 baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature")
1034 shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo)
1035
1036 cs, cmdTeardown := run.Stub()
1037 defer cmdTeardown(t)
1038 cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "")
1039 cs.Register(`git config branch\.feature\.merge`, 0, "refs/heads/feature\n")
1040 cs.Register(`git checkout feature`, 0, "")
1041
1042 output, err := runCommand(http, nil, "master", `123`, baseRepo)
1043 assert.NoError(t, err)
1044 assert.Equal(t, "", output.String())
1045 assert.Equal(t, "", output.Stderr())
1046}
1047
1048func TestPRCheckout_detachedHead(t *testing.T) {
1049 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