MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestLabelProjectList

Function TestLabelProjectList

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

Source from the content-addressed store, hash-verified

290}
291
292func TestLabelProjectList(t *testing.T) {
293 t.Parallel()
294
295 tests := []struct {
296 name string
297 visibilities []bool // true == private
298 wantIntegrity Integrity
299 wantConfidential Confidentiality
300 }{
301 {
302 name: "empty result is treated as public",
303 wantIntegrity: IntegrityUntrusted,
304 wantConfidential: ConfidentialityPublic,
305 },
306 {
307 name: "all public projects stay public",
308 visibilities: []bool{false, false},
309 wantIntegrity: IntegrityUntrusted,
310 wantConfidential: ConfidentialityPublic,
311 },
312 {
313 name: "mixed public and private projects become untrusted private",
314 visibilities: []bool{false, true},
315 wantIntegrity: IntegrityUntrusted,
316 wantConfidential: ConfidentialityPrivate,
317 },
318 {
319 name: "all private projects stay trusted private",
320 visibilities: []bool{true, true},
321 wantIntegrity: IntegrityTrusted,
322 wantConfidential: ConfidentialityPrivate,
323 },
324 }
325
326 for _, tc := range tests {
327 t.Run(tc.name, func(t *testing.T) {
328 t.Parallel()
329 label := LabelProjectList(tc.visibilities)
330 assert.Equal(t, tc.wantIntegrity, label.Integrity)
331 assert.Equal(t, tc.wantConfidential, label.Confidentiality)
332 })
333 }
334}
335
336func TestLabelProjectContent(t *testing.T) {
337 t.Parallel()

Callers

nothing calls this directly

Calls 1

LabelProjectListFunction · 0.85

Tested by

no test coverage detected