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

Function TestPRStatus_blankSlateRepoOverride

pkg/cmd/pr/status/status_test.go:405–428  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

403}
404
405func TestPRStatus_blankSlateRepoOverride(t *testing.T) {
406 http := initFakeHTTP()
407 defer http.Verify(t)
408 http.Register(httpmock.GraphQL(`query PullRequestStatus\b`), httpmock.StringResponse(`{"data": {}}`))
409
410 output, err := runCommand(http, "blueberries", true, "--repo OWNER/REPO")
411 if err != nil {
412 t.Errorf("error running command `pr status`: %v", err)
413 }
414
415 expected := `
416Relevant pull requests in OWNER/REPO
417
418Created by you
419 You have no open pull requests
420
421Requesting a code review from you
422 You have no pull requests to review
423
424`
425 if output.String() != expected {
426 t.Errorf("expected %q, got %q", expected, output.String())
427 }
428}
429
430func TestPRStatus_detachedHead(t *testing.T) {
431 http := initFakeHTTP()

Callers

nothing calls this directly

Calls 8

GraphQLFunction · 0.92
StringResponseFunction · 0.92
initFakeHTTPFunction · 0.70
runCommandFunction · 0.70
VerifyMethod · 0.65
ErrorfMethod · 0.65
StringMethod · 0.65
RegisterMethod · 0.45

Tested by

no test coverage detected