Skip to content
Permalink
Browse files

Add test for websocket response with request larger than read BUFSIZE

  • Loading branch information
spaceone committed Nov 2, 2016
1 parent 1a7a076 commit 1ac3e927bebb7de73fcca508942aaa71ee61e354
Showing with 6 additions and 1 deletion.
  1. +6 −1 tests/web/test_websockets.py
@@ -6,7 +6,7 @@

from circuits import Component
from circuits.web.controllers import Controller
from circuits.net.sockets import close, write
from circuits.net.sockets import close, write, BUFSIZE
from circuits.web.websockets import WebSocketClient, WebSocketsDispatcher


@@ -81,6 +81,11 @@ def test(manager, watcher, webapp):
assert watcher.wait("read", channel="ws")
assert client.response == "Received: Hello!"

data = "A" * (BUFSIZE + 1)
client.fire(write(data), "ws")
assert watcher.wait("read", channel="ws")
assert client.response == "Received: %s" % (data,)

f = urlopen(webapp.server.http.base)
s = f.read()
assert s == b"Hello World!"

0 comments on commit 1ac3e92

Please sign in to comment.
You can’t perform that action at this time.