aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_websockets.py
diff options
context:
space:
mode:
authorChandler Abraham <cabraham@twitter.com>2015-04-09 19:35:40 -0700
committerChandler Abraham <cabraham@twitter.com>2015-04-10 18:37:41 -0700
commite41e5cbfdd7b778e6f68e86658e95f9e413133cb (patch)
treed12b4e3c2e834f2d5efd0ec9c85dee159f508123 /test/test_websockets.py
parente58f76aec1db9cc784a3b73c3050d010bb084968 (diff)
downloadmitmproxy-e41e5cbfdd7b778e6f68e86658e95f9e413133cb.tar.gz
mitmproxy-e41e5cbfdd7b778e6f68e86658e95f9e413133cb.tar.bz2
mitmproxy-e41e5cbfdd7b778e6f68e86658e95f9e413133cb.zip
netlib websockets
Diffstat (limited to 'test/test_websockets.py')
-rw-r--r--test/test_websockets.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_websockets.py b/test/test_websockets.py
new file mode 100644
index 00000000..d7e1627f
--- /dev/null
+++ b/test/test_websockets.py
@@ -0,0 +1,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
+