(t *testing.T, e *Enforcer, user string, act string, prefix string, res []string, expectedErr error)
| 558 | } |
| 559 | |
| 560 | func testGetAllowedObjectConditions(t *testing.T, e *Enforcer, user string, act string, prefix string, res []string, expectedErr error) { |
| 561 | myRes, actualErr := e.GetAllowedObjectConditions(user, act, prefix) |
| 562 | |
| 563 | if actualErr != expectedErr { |
| 564 | t.Error("actual Err: ", actualErr, ", supposed to be ", expectedErr) |
| 565 | } |
| 566 | if actualErr == nil { |
| 567 | log.Print("Policy: ", myRes) |
| 568 | if !util.ArrayEquals(res, myRes) { |
| 569 | t.Error("Policy: ", myRes, ", supposed to be ", res) |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | func TestGetAllowedObjectConditions(t *testing.T) { |
| 575 | e, _ := NewEnforcer("examples/object_conditions_model.conf", "examples/object_conditions_policy.csv") |
no test coverage detected
searching dependent graphs…