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

Function verifySelectiveCallbackEntries

logger_test.go:215–232  ·  view source on GitHub ↗
(t *testing.T, entries []*log.LogEntry)

Source from the content-addressed store, hash-verified

213}
214
215func verifySelectiveCallbackEntries(t *testing.T, entries []*log.LogEntry) {
216 t.Helper()
217 found := map[log.EventType]bool{}
218
219 for _, entry := range entries {
220 found[entry.EventType] = true
221 checkEntryActiveStatus(t, entry)
222 }
223
224 requiredEvents := []log.EventType{
225 log.EventEnforce, log.EventAddPolicy, log.EventRemovePolicy, log.EventLoadPolicy,
226 }
227 for _, eventType := range requiredEvents {
228 if !found[eventType] {
229 t.Errorf("Expected to find %s in callback entries", eventType)
230 }
231 }
232}
233
234func checkEntryActiveStatus(t *testing.T, entry *log.LogEntry) {
235 t.Helper()

Callers 1

TestSetEventTypesFunction · 0.85

Calls 1

checkEntryActiveStatusFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…