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

Function TestReloadPolicy

enforcer_test.go:236–241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

234}
235
236func TestReloadPolicy(t *testing.T) {
237 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")
238
239 _ = e.LoadPolicy()
240 testGetPolicy(t, e, [][]string{{"alice", "data1", "read"}, {"bob", "data2", "write"}, {"data2_admin", "data2", "read"}, {"data2_admin", "data2", "write"}})
241}
242
243func TestSavePolicy(t *testing.T) {
244 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

Callers

nothing calls this directly

Calls 3

LoadPolicyMethod · 0.95
NewEnforcerFunction · 0.85
testGetPolicyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…