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

Function TestEnforcerSetDetectors

enforcer_test.go:787–803  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

785}
786
787func TestEnforcerSetDetectors(t *testing.T) {
788 // Test SetDetectors() method
789 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")
790
791 // Create multiple detectors
792 detectors := []detector.Detector{
793 detector.NewDefaultDetector(),
794 detector.NewDefaultDetector(),
795 }
796 e.SetDetectors(detectors)
797
798 // Should work with multiple detectors
799 err := e.RunDetections()
800 if err != nil {
801 t.Errorf("Expected no error with multiple detectors, but got: %v", err)
802 }
803}

Callers

nothing calls this directly

Calls 4

SetDetectorsMethod · 0.95
RunDetectionsMethod · 0.95
NewDefaultDetectorFunction · 0.92
NewEnforcerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…