MCPcopy Create free account
hub / github.com/apache/casbin-server / testGetUsers

Function testGetUsers

server/rbac_api_test.go:49–59  ·  view source on GitHub ↗
(t *testing.T, e *testEngine, name string, res []string)

Source from the content-addressed store, hash-verified

47}
48
49func testGetUsers(t *testing.T, e *testEngine, name string, res []string) {
50 t.Helper()
51 reply, err := e.s.GetUsersForRole(e.ctx, &pb.UserRoleRequest{EnforcerHandler: e.h, Role: name})
52 assert.NoError(t, err)
53
54 t.Log("Users for ", name, ": ", reply.Array)
55
56 if !util.SetEquals(res, reply.Array) {
57 t.Error("Users for ", name, ": ", reply.Array, ", supposed to be ", res)
58 }
59}
60
61func testHasRole(t *testing.T, e *testEngine, name string, role string, res bool) {
62 t.Helper()

Callers 1

Calls 1

GetUsersForRoleMethod · 0.65

Tested by

no test coverage detected