grim/hgkeeper

0f009a337675
Parents 00140ff02051
Children 7dcc72aff778
Remove old tests that references code that was deleted long ago
--- a/access/access_test.go Fri May 08 04:39:00 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-package access
-
-import (
- "strings"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestAccessControlLoadSimple(t *testing.T) {
- data := `
-global:
- init:
- - admins
- read:
- - public
-groups:
- admins:
- - root
-patterns:
- hgkeeper:
- read:
- - admins
-`
-
- a := New("")
- err := a.load(strings.NewReader(data))
- assert.Nil(t, err)
-
- assert.NotNil(t, a)
- assert.Equal(
- t,
- Acl{
- Init: []string{"admins"},
- Read: []string{"public"},
- Write: nil,
- },
- a.global,
- )
- assert.Equal(
- t,
- map[string][]string{
- "admins": []string{"root"},
- },
- a.groups,
- )
- assert.Equal(
- t,
- Acl{
- Init: nil,
- Read: []string{"admins"},
- Write: nil,
- },
- a.patterns["hgkeeper"],
- )
-
- assert.ElementsMatch(
- t,
- []string{"root", "public"},
- a.findUsers(),
- )
-}
-
-func TestAccessFindUsersComplicated(t *testing.T) {
- data := `
-global:
- init:
- - admins
- read:
- - public
-groups:
- admins:
- - foo
- - bar
- devs:
- - baz
- - qux
- managers:
- - admins
- - devs
- - quux
-patterns:
- hgkeeper/:
- write:
- - admins
- read:
- - admins
- project1/:
- read:
- - foobar
- - devs
- - admins
-`
-
- a := New("")
- err := a.load(strings.NewReader(data))
- assert.Nil(t, err)
-
- assert.NotNil(t, a)
-
- assert.ElementsMatch(
- t,
- []string{"public", "foo", "foobar", "bar", "baz", "qux", "quux"},
- a.findUsers(),
- )
-}