MCPcopy Index your code
hub / github.com/apache/casbin / testHasGroupingPolicy

Function testHasGroupingPolicy

management_api_test.go:141–153  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, policy []string, res bool)

Source from the content-addressed store, hash-verified

139}
140
141func testHasGroupingPolicy(t *testing.T, e *Enforcer, policy []string, res bool) {
142 t.Helper()
143 myRes, err := e.HasGroupingPolicy(policy)
144 if err != nil {
145 t.Error(err)
146 }
147
148 t.Log("Has grouping policy ", util.ArrayToString(policy), ": ", myRes)
149
150 if res != myRes {
151 t.Error("Has grouping policy ", util.ArrayToString(policy), ": ", myRes, ", supposed to be ", res)
152 }
153}
154
155func TestGetPolicyAPI(t *testing.T) {
156 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

Callers 2

TestGetPolicyAPIFunction · 0.85

Calls 3

ArrayToStringFunction · 0.92
HasGroupingPolicyMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…