Initial commit

This commit is contained in:
yan.y
2024-03-27 23:25:08 +08:00
commit 0884384e91
127 changed files with 9353 additions and 0 deletions
+29
View File
@@ -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")
}
}