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

Function TestPullRequestRepositoryViewerPermission

api/queries_pr_test.go:614–637  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

612}
613
614func TestPullRequestRepositoryViewerPermission(t *testing.T) {
615 tests := []struct {
616 name string
617 pr PullRequest
618 want string
619 }{
620 {
621 name: "the repository field was requested",
622 pr: PullRequest{Repository: &PRRepository{ViewerPermission: "WRITE"}},
623 want: "WRITE",
624 },
625 {
626 name: "the repository field was not requested",
627 pr: PullRequest{},
628 want: "",
629 },
630 }
631
632 for _, tt := range tests {
633 t.Run(tt.name, func(t *testing.T) {
634 assert.Equal(t, tt.want, tt.pr.RepositoryViewerPermission())
635 })
636 }
637}

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected