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

Function TestIssueRepositoryViewerPermission

api/queries_issue_test.go:34–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestIssueRepositoryViewerPermission(t *testing.T) {
35 tests := []struct {
36 name string
37 issue Issue
38 want string
39 }{
40 {
41 name: "the repository field was requested",
42 issue: Issue{Repository: &PRRepository{ViewerPermission: "WRITE"}},
43 want: "WRITE",
44 },
45 {
46 name: "the repository field was not requested",
47 issue: Issue{},
48 want: "",
49 },
50 }
51
52 for _, tt := range tests {
53 t.Run(tt.name, func(t *testing.T) {
54 assert.Equal(t, tt.want, tt.issue.RepositoryViewerPermission())
55 })
56 }
57}

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected