Fix order of streaming WebSocket test

pull/51/head
178inaba 2017-04-30 22:16:50 +09:00
parent fc574ac209
commit 9dc59ebc73
1 changed files with 14 additions and 14 deletions

View File

@ -10,20 +10,6 @@ import (
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )
func TestStreamingWSPublic(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(wsMock))
defer ts.Close()
client := NewClient(&Config{Server: ts.URL}).NewWSClient()
ctx, cancel := context.WithCancel(context.Background())
q, err := client.StreamingWSPublic(ctx, false)
if err != nil {
t.Fatalf("should not be fail: %v", err)
}
wsTest(t, q, cancel)
}
func TestStreamingWSUser(t *testing.T) { func TestStreamingWSUser(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(wsMock)) ts := httptest.NewServer(http.HandlerFunc(wsMock))
defer ts.Close() defer ts.Close()
@ -38,6 +24,20 @@ func TestStreamingWSUser(t *testing.T) {
wsTest(t, q, cancel) wsTest(t, q, cancel)
} }
func TestStreamingWSPublic(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(wsMock))
defer ts.Close()
client := NewClient(&Config{Server: ts.URL}).NewWSClient()
ctx, cancel := context.WithCancel(context.Background())
q, err := client.StreamingWSPublic(ctx, false)
if err != nil {
t.Fatalf("should not be fail: %v", err)
}
wsTest(t, q, cancel)
}
func TestStreamingWSHashtag(t *testing.T) { func TestStreamingWSHashtag(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(wsMock)) ts := httptest.NewServer(http.HandlerFunc(wsMock))
defer ts.Close() defer ts.Close()