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

Function TestPRStatus_detachedHead

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

Source from the content-addressed store, hash-verified

428}
429
430func TestPRStatus_detachedHead(t *testing.T) {
431 http := initFakeHTTP()
432 defer http.Verify(t)
433 http.Register(httpmock.GraphQL(`query PullRequestStatus\b`), httpmock.StringResponse(`{"data": {}}`))
434
435 output, err := runCommand(http, "", true, "")
436 if err != nil {
437 t.Errorf("error running command `pr status`: %v", err)
438 }
439
440 expected := `
441Relevant pull requests in OWNER/REPO
442
443Current branch
444 There is no current branch
445
446Created by you
447 You have no open pull requests
448
449Requesting a code review from you
450 You have no pull requests to review
451
452`
453 if output.String() != expected {
454 t.Errorf("expected %q, got %q", expected, output.String())
455 }
456}
457
458func TestPRStatus_error_ReadBranchConfig(t *testing.T) {
459 rs, cleanup := run.Stub()

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