plugins/tests/redis_test.go
Star b6bb3098bc update dao
many other updates
2024-03-24 12:28:02 +08:00

25 lines
548 B
Go

package tests
import (
"apigo.cloud/git/apigo/gojs"
"apigo.cloud/git/apigo/plugin"
_ "apigo.cloud/git/apigo/plugins/redis"
"testing"
)
func TestRedis(t *testing.T) {
rdServer := StartRedis("16378")
defer rdServer.Close()
gojs.SetPluginsConfig(map[string]plugin.Config{
"apigo.cloud/git/apigo/plugins/redis": {
"default": "redis://localhost:16378",
"configs": map[string]string{
"bak": "redis://localhost:16378/2",
},
},
})
r, err := gojs.RunFile("redis_test.js", nil)
Test(t, "get", r == true && err == nil, r, err)
}