summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-11-23 15:53:48 -0800
committer=Corey Hulen <corey@hulen.com>2015-11-23 15:53:48 -0800
commit4f4cd5e63573da4d6edcc7d4213afaca67c19f88 (patch)
treecefbc7af53629d97644ca2f6b2369e9d879f0101 /Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go
parentf8a3c9a14edca6df0647d89cf225f2470cbe025c (diff)
downloadchat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.tar.gz
chat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.tar.bz2
chat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.zip
upgrading libs
Diffstat (limited to 'Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go')
-rw-r--r--Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go22
1 files changed, 10 insertions, 12 deletions
diff --git a/Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go b/Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go
index 365a58821..05e60763c 100644
--- a/Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go
+++ b/Godeps/_workspace/src/github.com/garyburd/redigo/redis/pubsub_test.go
@@ -16,20 +16,18 @@ package redis_test
import (
"fmt"
- "net"
"reflect"
"sync"
"testing"
- "time"
- "github.com/garyburd/redigo/internal/redistest"
- "github.com/garyburd/redigo/redis"
+ "github.com/mattermost/platform/Godeps/_workspace/src/github.com/garyburd/redigo/redis"
)
func publish(channel, value interface{}) {
c, err := dial()
if err != nil {
- panic(err)
+ fmt.Println(err)
+ return
}
defer c.Close()
c.Do("PUBLISH", channel, value)
@@ -39,7 +37,8 @@ func publish(channel, value interface{}) {
func ExamplePubSubConn() {
c, err := dial()
if err != nil {
- panic(err)
+ fmt.Println(err)
+ return
}
defer c.Close()
var wg sync.WaitGroup
@@ -111,20 +110,19 @@ func expectPushed(t *testing.T, c redis.PubSubConn, message string, expected int
}
func TestPushed(t *testing.T) {
- pc, err := redistest.Dial()
+ pc, err := redis.DialDefaultServer()
if err != nil {
t.Fatalf("error connection to database, %v", err)
}
defer pc.Close()
- nc, err := net.Dial("tcp", ":6379")
+ sc, err := redis.DialDefaultServer()
if err != nil {
- t.Fatal(err)
+ t.Fatalf("error connection to database, %v", err)
}
- defer nc.Close()
- nc.SetReadDeadline(time.Now().Add(4 * time.Second))
+ defer sc.Close()
- c := redis.PubSubConn{Conn: redis.NewConn(nc, 0, 0)}
+ c := redis.PubSubConn{Conn: sc}
c.Subscribe("c1")
expectPushed(t, c, "Subscribe(c1)", redis.Subscription{Kind: "subscribe", Channel: "c1", Count: 1})