diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-06-06 18:17:22 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-06-06 18:17:22 +1200 |
commit | 210c376901b4a84785a1f28be01a9a635f6c7239 (patch) | |
tree | 18a582b8d3d25fd700ba3c68a1e9698509d9e0ee | |
parent | 21c7218ee34bdaa43583a0daf0bfaf11498ce61b (diff) | |
download | mitmproxy-210c376901b4a84785a1f28be01a9a635f6c7239.tar.gz mitmproxy-210c376901b4a84785a1f28be01a9a635f6c7239.tar.bz2 mitmproxy-210c376901b4a84785a1f28be01a9a635f6c7239.zip |
Fix sequencing in Pathoc websocket termination test
-rw-r--r-- | pathod/pathoc.py | 1 | ||||
-rw-r--r-- | test/pathod/test_pathoc.py | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/pathod/pathoc.py b/pathod/pathoc.py index 4c708fc9..3eb91637 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -361,6 +361,7 @@ class Pathoc(tcp.TCPClient): return if frm is None: self.ws_framereader.join() + self.ws_framereader = None return yield frm diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index 20876f2a..dc5011c0 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -154,9 +154,10 @@ class TestDaemon(PathocTestDaemon): ) with c.connect(): c.request("ws:/") - c.request("wf:f'wf:x100'") - [i for i in c.wait(timeout=0, finish=False)] - [i for i in c.wait(timeout=0)] + c.request("wf:f'wf'") + # This should read a frame and close the websocket reader + assert len([i for i in c.wait(timeout=5, finish=False)]) == 1 + assert not [i for i in c.wait(timeout=0)] def test_connect_fail(self): to = ("foobar", 80) |