MCPcopy Create free account
hub / github.com/belak/gitdir / TestCheckListsForUser

Function TestCheckListsForUser

repo_test.go:248–261  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

246}
247
248func TestCheckListsForUser(t *testing.T) {
249 t.Parallel()
250
251 c := newTestConfig()
252
253 // Basic checks
254 assert.False(t, c.checkListsForUser("an-admin"))
255 assert.True(t, c.checkListsForUser("an-admin", []string{"an-admin"}))
256 assert.True(t, c.checkListsForUser("an-admin", []string{"$admins"}))
257 assert.True(t, c.checkListsForUser("an-admin", []string{"$nested-admins"}))
258
259 // Ensure loops don't crash this
260 assert.False(t, c.checkListsForUser("an-admin", []string{"$loop"}))
261}
262
263type allRepoAccessLevels struct {
264 Admin AccessLevel

Callers

nothing calls this directly

Calls 2

newTestConfigFunction · 0.85
checkListsForUserMethod · 0.80

Tested by

no test coverage detected