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

Function TestModelNoError

error_test.go:116–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestModelNoError(t *testing.T) {
117 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
118
119 e.modelPath = "hope_this_path_wont_exist"
120 err := e.LoadModel()
121
122 if err == nil {
123 t.Errorf("Should be error here.")
124 } else {
125 t.Log("Test on error: ")
126 t.Log(err.Error())
127 }
128}
129
130func TestMockAdapterErrors(t *testing.T) {
131 adapter := fileadapter.NewAdapterMock("examples/rbac_with_domains_policy.csv")

Callers

nothing calls this directly

Calls 3

LoadModelMethod · 0.95
NewEnforcerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…