瀏覽代碼

Merged upstream/master. Updated test case with Bens recommendations to return a message for incorrect error type and also if no error was returned.

Phillip Couto 12 年之前
父節點
當前提交
cf29781cb2
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      cassandra_test.go

+ 6 - 2
cassandra_test.go

@@ -284,9 +284,13 @@ func TestCreateSessionTimeout(t *testing.T) {
 	}()
 	c := NewCluster("127.0.0.1:1")
 	c.StartupTimeout = 1 * time.Second
+	_, err := c.CreateSession()
 
-	if _, err := c.CreateSession(); err != ErrNoConnections {
-		t.Fatal("Create session did not fail with the ErrNoConnections error.")
+	if err == nil {
+		t.Fatal("expected ErrNoConncetions, but no error was returned.")
+	}
+	if err != ErrNoConnections {
+		t.Fatal("expected ErrNoConnections, but recevied %v", err)
 	}
 }