MCPcopy
hub / github.com/apache/casbin / TestSetAdapterFromFile

Function TestSetAdapterFromFile

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

Source from the content-addressed store, hash-verified

400}
401
402func TestSetAdapterFromFile(t *testing.T) {
403 e, _ := NewEnforcer("examples/basic_model.conf")
404
405 testEnforce(t, e, "alice", "data1", "read", false)
406
407 a := fileadapter.NewAdapter("examples/basic_policy.csv")
408 e.SetAdapter(a)
409 _ = e.LoadPolicy()
410
411 testEnforce(t, e, "alice", "data1", "read", true)
412}
413
414func TestInitEmpty(t *testing.T) {
415 e, _ := NewEnforcer()

Callers

nothing calls this directly

Calls 4

SetAdapterMethod · 0.95
LoadPolicyMethod · 0.95
NewEnforcerFunction · 0.85
testEnforceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…