aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_websockets.py
blob: d7e1627fa2c42116906b2468208cc49c24280a82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from netlib import test
from netlib.websockets import implementations as ws

class TestWebSockets(test.ServerTestBase):
    handler = ws.WebSocketsEchoHandler

    def test_websockets_echo(self):
        msg    = "hello I'm the client"
        client = ws.WebSocketsClient(("127.0.0.1", self.port))
        client.connect()
        client.send_message(msg)
        response = client.read_next_message()
        print "Assert response: " + response + " == msg: " + msg
        assert response == msg