(t *testing.T, e *Enforcer, policy []string, res bool)
| 139 | } |
| 140 | |
| 141 | func 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 | |
| 155 | func TestGetPolicyAPI(t *testing.T) { |
| 156 | e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv") |
no test coverage detected
searching dependent graphs…