aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/service_test.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/admin/service_test.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/internal/admin/service_test.go b/internal/admin/service_test.go
index 06088bc..9af6bb9 100644
--- a/internal/admin/service_test.go
+++ b/internal/admin/service_test.go
@@ -108,7 +108,12 @@ func TestInitServer(t *testing.T) {
{"role:maintainers", "/thisismynewrepo/git-receive-pack", "POST"},
}
for _, policy := range expectedPolicies {
- if !svc.HasPolicy(policy[0], policy[1], policy[2]) {
+ hasPolicy, err := svc.HasPolicy(policy[0], policy[1], policy[2])
+ if err != nil {
+ t.Log("error checking policies", err)
+ t.Fail()
+ }
+ if !hasPolicy {
t.Log("policy not found", policy)
t.Fail()
}
@@ -136,10 +141,16 @@ func TestInitServer(t *testing.T) {
{"role:admin", "/mgmt/git-receive-pack", "POST"},
}
for _, policy := range expectedPolicies {
- if !svc.HasPolicy(policy[0], policy[1], policy[2]) {
+ hasPolicy, err := svc.HasPolicy(policy[0], policy[1], policy[2])
+ if err != nil {
+ t.Log("error checking policies", err)
+ t.Fail()
+ }
+ if !hasPolicy {
t.Log("policy not found", policy)
t.Fail()
}
+
}
})
t.Run("test an unitialized server config", func(t *testing.T) {