MCPcopy
hub / github.com/github/github-mcp-server / TestLabelRelease

Function TestLabelRelease

pkg/ifc/ifc_test.go:124–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestLabelRelease(t *testing.T) {
125 t.Parallel()
126
127 t.Run("public repo with no draft is trusted and public", func(t *testing.T) {
128 t.Parallel()
129 label := LabelRelease(false, false)
130 assert.Equal(t, IntegrityTrusted, label.Integrity)
131 assert.Equal(t, ConfidentialityPublic, label.Confidentiality)
132 })
133
134 t.Run("public repo with a draft release is private", func(t *testing.T) {
135 t.Parallel()
136 // Draft releases are visible only to push-access users, so a draft on
137 // a public repo must not be labeled public.
138 label := LabelRelease(false, true)
139 assert.Equal(t, IntegrityTrusted, label.Integrity)
140 assert.Equal(t, ConfidentialityPrivate, label.Confidentiality)
141 })
142
143 t.Run("private repo is private regardless of draft", func(t *testing.T) {
144 t.Parallel()
145 for _, hasDraft := range []bool{false, true} {
146 label := LabelRelease(true, hasDraft)
147 assert.Equal(t, IntegrityTrusted, label.Integrity)
148 assert.Equal(t, ConfidentialityPrivate, label.Confidentiality)
149 }
150 })
151}
152
153func TestLabelCollaboratorRoster(t *testing.T) {
154 t.Parallel()

Callers

nothing calls this directly

Calls 1

LabelReleaseFunction · 0.85

Tested by

no test coverage detected