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

Function TestNewModelFromString

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

Source from the content-addressed store, hash-verified

63}
64
65func TestNewModelFromString(t *testing.T) {
66 modelBytes, _ := ioutil.ReadFile(basicExample)
67 modelString := string(modelBytes)
68 m, err := NewModelFromString(modelString)
69 if err != nil {
70 t.Errorf("model failed to load from string: %s", err)
71 }
72 if m == nil {
73 t.Error("model should not be nil")
74 }
75}
76
77func TestLoadModelFromConfig(t *testing.T) {
78 m := NewModel()

Callers

nothing calls this directly

Calls 2

NewModelFromStringFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…