add more tests for stores (#446)
parent
852891dbd8
commit
745e76c335
@ -0,0 +1,19 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestBlockingNode(t *testing.T) {
|
||||
r, err := miniredis.Run()
|
||||
assert.Nil(t, err)
|
||||
node, err := CreateBlockingNode(NewRedis(r.Addr(), NodeType))
|
||||
assert.Nil(t, err)
|
||||
node.Close()
|
||||
node, err = CreateBlockingNode(NewRedis(r.Addr(), ClusterType))
|
||||
assert.Nil(t, err)
|
||||
node.Close()
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestScriptCache(t *testing.T) {
|
||||
cache := GetScriptCache()
|
||||
cache.SetSha("foo", "bar")
|
||||
cache.SetSha("bla", "blabla")
|
||||
bar, ok := cache.GetSha("foo")
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, "bar", bar)
|
||||
}
|
Loading…
Reference in New Issue