Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package casbin
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"pet-house.com/core/helper/dir"
|
||||
)
|
||||
|
||||
func TestRemove(t *testing.T) {
|
||||
t.Run("Test casbin instance", func(t *testing.T) {
|
||||
casbin := Instance()
|
||||
if casbin == nil {
|
||||
t.Error("casbin instance is nil")
|
||||
}
|
||||
})
|
||||
casbinPath := getCasbinPath()
|
||||
if !dir.IsExist(casbinPath) || !dir.IsFile(casbinPath) {
|
||||
t.Error("casbin file is not exist")
|
||||
}
|
||||
t.Run("Test casbin config remove", func(t *testing.T) {
|
||||
err := Remove()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
if dir.IsExist(casbinPath) && dir.IsFile(casbinPath) {
|
||||
t.Error("casbin file is delete fail")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user