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

Function testHasPolicy

management_api_test.go:127–139  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, policy []string, res bool)

Source from the content-addressed store, hash-verified

125}
126
127func testHasPolicy(t *testing.T, e *Enforcer, policy []string, res bool) {
128 t.Helper()
129 myRes, err := e.HasPolicy(policy)
130 if err != nil {
131 t.Error(err)
132 }
133
134 t.Log("Has policy ", util.ArrayToString(policy), ": ", myRes)
135
136 if res != myRes {
137 t.Error("Has policy ", util.ArrayToString(policy), ": ", myRes, ", supposed to be ", res)
138 }
139}
140
141func testHasGroupingPolicy(t *testing.T, e *Enforcer, policy []string, res bool) {
142 t.Helper()

Callers 5

TestGetPolicyAPIFunction · 0.85
TestInitFilteredAdapterFunction · 0.85
TestLoadFilteredPolicyFunction · 0.85
TestAppendFilteredPolicyFunction · 0.85

Calls 3

ArrayToStringFunction · 0.92
HasPolicyMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…