aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-06-05 16:03:17 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-06-05 16:03:17 +1200
commit7412ec83f55e6a9dcdde84603b88cd67bbf8b04d (patch)
treec66f062afe1c08ef05b714fa26306a243e603994 /test
parentd23691f98c9e421a05db0519e8a19388db3a97be (diff)
downloadmitmproxy-7412ec83f55e6a9dcdde84603b88cd67bbf8b04d.tar.gz
mitmproxy-7412ec83f55e6a9dcdde84603b88cd67bbf8b04d.tar.bz2
mitmproxy-7412ec83f55e6a9dcdde84603b88cd67bbf8b04d.zip
Refactor pathoc message receive to use queues and generators
This gives us a nicer, thread-safe interface.
Diffstat (limited to 'test')
-rw-r--r--test/test_pathod.py6
-rw-r--r--test/tutils.py9
2 files changed, 8 insertions, 7 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py
index d3013692..55a5b32e 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -210,10 +210,8 @@ class CommonTests(tutils.DaemonTests):
assert r.status_code == 101
def test_websocket_frame(self):
- r = self.pathoc(["ws:/p/", "wf:f'wf'"], ws_read_limit=1)
- #print r
- #pprint.pprint(r)
- #pprint.pprint(self.d.log())
+ r = self.pathoc(["ws:/p/", "wf:f'wf:b\"test\"'"], ws_read_limit=1)
+ assert r[1].payload == "test"
class TestDaemon(CommonTests):
diff --git a/test/tutils.py b/test/tutils.py
index dc118bbe..1e33dfe7 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -88,9 +88,12 @@ class DaemonTests(object):
c.settimeout(timeout)
ret = []
for i in specs:
- ret.append(c.request(i))
- return ret
-
+ resp = c.request(i)
+ if resp:
+ ret.append(resp)
+ for frm in c.wait():
+ ret.append(frm)
+ return ret
@contextmanager
def tmpdir(*args, **kwargs):