diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-30 08:03:26 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-30 08:03:26 +1200 |
commit | f927701e74a3b6a22694a0d55e918febbeca9e98 (patch) | |
tree | 7796b5cdc97cbded0a5e2e924d41d08b79851e61 /test | |
parent | 7e69fab331297f08ce066667ebd8a2daefce6747 (diff) | |
download | mitmproxy-f927701e74a3b6a22694a0d55e918febbeca9e98.tar.gz mitmproxy-f927701e74a3b6a22694a0d55e918febbeca9e98.tar.bz2 mitmproxy-f927701e74a3b6a22694a0d55e918febbeca9e98.zip |
Websocket frame read limit.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_language.py | 1 | ||||
-rw-r--r-- | test/test_pathod.py | 4 | ||||
-rw-r--r-- | test/tutils.py | 15 |
3 files changed, 15 insertions, 5 deletions
diff --git a/test/test_language.py b/test/test_language.py index 0fb8479d..c0eafcaa 100644 --- a/test/test_language.py +++ b/test/test_language.py @@ -638,7 +638,6 @@ class TestRequest: class TestWebsocketFrame: - def test_spec(self): e = language.WebsocketFrame.expr() wf = e.parseString("wf:b'foo'") diff --git a/test/test_pathod.py b/test/test_pathod.py index 1a10d2c2..bfff3274 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -185,10 +185,10 @@ class CommonTests(tutils.DaemonTests): assert r.status_code == 202 def test_websocket(self): - r = self.pathoc("ws:/p/") + r = self.pathoc("ws:/p/", ws_read_limit=0) assert r.status_code == 101 - r = self.pathoc("ws:/p/ws") + r = self.pathoc("ws:/p/ws", ws_read_limit=0) assert r.status_code == 101 diff --git a/test/tutils.py b/test/tutils.py index 4c29f5b2..f8a37a5e 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -64,10 +64,21 @@ class DaemonTests(object): def get(self, spec): return requests.get(self.d.p(spec), verify=False) - def pathoc(self, spec, timeout=None, connect_to=None, ssl=None): + def pathoc( + self, + spec, + timeout=None, + connect_to=None, + ssl=None, + ws_read_limit=None + ): if ssl is None: ssl = self.ssl - c = pathoc.Pathoc(("localhost", self.d.port), ssl=ssl) + c = pathoc.Pathoc( + ("localhost", self.d.port), + ssl=ssl, + ws_read_limit=ws_read_limit + ) c.connect(connect_to) if timeout: c.settimeout(timeout) |