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

Function testModel

server/model_test.go:117–126  ·  view source on GitHub ↗
(t *testing.T, s *Server, enforcerHandler int32, sub string, obj string, act string, res bool)

Source from the content-addressed store, hash-verified

115}
116
117func testModel(t *testing.T, s *Server, enforcerHandler int32, sub string, obj string, act string, res bool) {
118 t.Helper()
119
120 reply, err := s.Enforce(context.TODO(), &pb.EnforceRequest{EnforcerHandler: enforcerHandler, Params: []string{sub, obj, act}})
121 assert.NoError(t, err)
122
123 if reply.Res != res {
124 t.Errorf("%s, %v, %s: %t, supposed to be %t", sub, obj, act, !res, res)
125 }
126}

Callers 1

TestABACModelFunction · 0.85

Calls 1

EnforceMethod · 0.65

Tested by

no test coverage detected