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

Function testGetPolicy

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

Source from the content-addressed store, hash-verified

55}
56
57func testGetPolicy(t *testing.T, e *Enforcer, res [][]string) {
58 t.Helper()
59 myRes, err := e.GetPolicy()
60 if err != nil {
61 t.Error(err)
62 }
63
64 t.Log("Policy: ", myRes)
65
66 if !util.SortedArray2DEquals(res, myRes) {
67 t.Error("Policy: ", myRes, ", supposed to be ", res)
68 }
69}
70
71func testGetFilteredPolicy(t *testing.T, e *Enforcer, fieldIndex int, res [][]string, fieldValues ...string) {
72 t.Helper()

Callers 3

TestReloadPolicyFunction · 0.85
TestGetPolicyAPIFunction · 0.85
TestModifyPolicyAPIFunction · 0.85

Calls 3

SortedArray2DEqualsFunction · 0.92
GetPolicyMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…