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

Function TestFilteredPolicyInvalidFilter

filter_test.go:149–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestFilteredPolicyInvalidFilter(t *testing.T) {
150 e, _ := NewEnforcer()
151
152 adapter := fileadapter.NewFilteredAdapter("examples/rbac_with_domains_policy.csv")
153 _ = e.InitWithAdapter("examples/rbac_with_domains_model.conf", adapter)
154
155 if err := e.LoadFilteredPolicy([]string{"", "domain1"}); err == nil {
156 t.Errorf("expected error in LoadFilteredPolicy, but got nil")
157 }
158}
159
160func TestFilteredPolicyEmptyFilter(t *testing.T) {
161 e, _ := NewEnforcer()

Callers

nothing calls this directly

Calls 3

InitWithAdapterMethod · 0.95
LoadFilteredPolicyMethod · 0.95
NewEnforcerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…