(t *testing.T)
| 114 | } |
| 115 | |
| 116 | func TestModelNoError(t *testing.T) { |
| 117 | e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv") |
| 118 | |
| 119 | e.modelPath = "hope_this_path_wont_exist" |
| 120 | err := e.LoadModel() |
| 121 | |
| 122 | if err == nil { |
| 123 | t.Errorf("Should be error here.") |
| 124 | } else { |
| 125 | t.Log("Test on error: ") |
| 126 | t.Log(err.Error()) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func TestMockAdapterErrors(t *testing.T) { |
| 131 | adapter := fileadapter.NewAdapterMock("examples/rbac_with_domains_policy.csv") |
nothing calls this directly
no test coverage detected
searching dependent graphs…