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

Function TestGetAndSetModel

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

Source from the content-addressed store, hash-verified

374}
375
376func TestGetAndSetModel(t *testing.T) {
377 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
378 e2, _ := NewEnforcer("examples/basic_with_root_model.conf", "examples/basic_policy.csv")
379
380 testEnforce(t, e, "root", "data1", "read", false)
381
382 e.SetModel(e2.GetModel())
383
384 testEnforce(t, e, "root", "data1", "read", true)
385}
386
387func TestGetAndSetAdapterInMem(t *testing.T) {
388 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")

Callers

nothing calls this directly

Calls 4

SetModelMethod · 0.95
GetModelMethod · 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…