redisblockingnode_test.go 396 B

12345678910111213141516171819
  1. package redis
  2. import (
  3. "testing"
  4. "github.com/alicebob/miniredis/v2"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestBlockingNode(t *testing.T) {
  8. r, err := miniredis.Run()
  9. assert.Nil(t, err)
  10. node, err := CreateBlockingNode(NewRedis(r.Addr(), NodeType))
  11. assert.Nil(t, err)
  12. node.Close()
  13. node, err = CreateBlockingNode(NewRedis(r.Addr(), ClusterType))
  14. assert.Nil(t, err)
  15. node.Close()
  16. }