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

Function TestPrInMergeQueue

pkg/cmd/pr/merge/merge_test.go:1857–1886  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1855}
1856
1857func TestPrInMergeQueue(t *testing.T) {
1858 http := initFakeHTTP()
1859 defer http.Verify(t)
1860
1861 shared.StubFinderForRunCommandStyleTests(t,
1862 "1",
1863 &api.PullRequest{
1864 ID: "THE-ID",
1865 Number: 1,
1866 State: "OPEN",
1867 Title: "The title of the PR",
1868 MergeStateStatus: "CLEAN",
1869 IsInMergeQueue: true,
1870 IsMergeQueueEnabled: true,
1871 },
1872 baseRepo("OWNER", "REPO", "main"),
1873 )
1874
1875 cs, cmdTeardown := run.Stub()
1876 defer cmdTeardown(t)
1877 cs.Register(`git rev-parse --verify refs/heads/`, 0, "")
1878
1879 output, err := runCommand(http, nil, "blueberries", true, "pr merge 1")
1880 if err != nil {
1881 t.Fatalf("error running command `pr merge`: %v", err)
1882 }
1883
1884 assert.Equal(t, "", output.String())
1885 assert.Equal(t, "! Pull request OWNER/REPO#1 is already queued to merge\n", output.Stderr())
1886}
1887
1888func TestPrAddToMergeQueueWithMergeMethod(t *testing.T) {
1889 http := initFakeHTTP()

Callers

nothing calls this directly

Calls 10

StubFunction · 0.92
baseRepoFunction · 0.85
EqualMethod · 0.80
StderrMethod · 0.80
initFakeHTTPFunction · 0.70
runCommandFunction · 0.70
VerifyMethod · 0.65
StringMethod · 0.65
RegisterMethod · 0.45

Tested by

no test coverage detected