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

Function TestHasSection

model/model_test.go:97–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestHasSection(t *testing.T) {
98 m := NewModel()
99 _ = m.loadModelFromConfig(basicConfig)
100 for _, sec := range requiredSections {
101 if !m.hasSection(sec) {
102 t.Errorf("%s section was expected in model", sec)
103 }
104 }
105 m = NewModel()
106 _ = m.loadModelFromConfig(&MockConfig{})
107 for _, sec := range requiredSections {
108 if m.hasSection(sec) {
109 t.Errorf("%s section was not expected in model", sec)
110 }
111 }
112}
113
114func TestModel_AddDef(t *testing.T) {
115 m := NewModel()

Callers

nothing calls this directly

Calls 3

loadModelFromConfigMethod · 0.95
hasSectionMethod · 0.95
NewModelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…