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

Function TestStopAutoLoadPolicy

enforcer_synced_test.go:60–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

58}
59
60func TestStopAutoLoadPolicy(t *testing.T) {
61 e, _ := NewSyncedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
62 e.StartAutoLoadPolicy(5 * time.Millisecond)
63 if !e.IsAutoLoadingRunning() {
64 t.Error("auto load is not running")
65 }
66 e.StopAutoLoadPolicy()
67 // Need a moment, to exit goroutine
68 time.Sleep(10 * time.Millisecond)
69 if e.IsAutoLoadingRunning() {
70 t.Error("auto load is still running")
71 }
72}
73
74func testSyncedEnforcerGetPolicy(t *testing.T, e *SyncedEnforcer, res [][]string) {
75 t.Helper()

Callers

nothing calls this directly

Calls 5

StartAutoLoadPolicyMethod · 0.95
IsAutoLoadingRunningMethod · 0.95
StopAutoLoadPolicyMethod · 0.95
NewSyncedEnforcerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…