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

Function TestNoError

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

Source from the content-addressed store, hash-verified

89}
90
91func TestNoError(t *testing.T) {
92 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
93
94 err := e.LoadModel()
95 if err != nil {
96 t.Errorf("Should be no error here.")
97 t.Log("Unexpected error: ")
98 t.Log(err.Error())
99 }
100
101 err = e.LoadPolicy()
102 if err != nil {
103 t.Errorf("Should be no error here.")
104 t.Log("Unexpected error: ")
105 t.Log(err.Error())
106 }
107
108 err = e.SavePolicy()
109 if err != nil {
110 t.Errorf("Should be no error here.")
111 t.Log("Unexpected error: ")
112 t.Log(err.Error())
113 }
114}
115
116func TestModelNoError(t *testing.T) {
117 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")

Callers

nothing calls this directly

Calls 5

LoadModelMethod · 0.95
LoadPolicyMethod · 0.95
SavePolicyMethod · 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…