(t *testing.T)
| 596 | } |
| 597 | |
| 598 | func TestFailedToLoadPolicy(t *testing.T) { |
| 599 | e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv") |
| 600 | e.AddNamedMatchingFunc("g2", "matchingFunc", util.KeyMatch2) |
| 601 | testEnforce(t, e, "alice", "/book/1", "GET", true) |
| 602 | testEnforce(t, e, "bob", "/pen/3", "GET", true) |
| 603 | e.SetAdapter(fileadapter.NewAdapter("not found")) |
| 604 | _ = e.LoadPolicy() |
| 605 | testEnforce(t, e, "alice", "/book/1", "GET", true) |
| 606 | testEnforce(t, e, "bob", "/pen/3", "GET", true) |
| 607 | } |
| 608 | |
| 609 | func TestReloadPolicyWithFunc(t *testing.T) { |
| 610 | e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv") |
nothing calls this directly
no test coverage detected
searching dependent graphs…