diff options
| author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-31 18:38:11 +1200 |
|---|---|---|
| committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-31 18:38:11 +1200 |
| commit | 6122f2da444e114091d6aec8e01a43d760503d06 (patch) | |
| tree | e1d79af0525ec7c67e136f4448fdd4aa1c4415f2 /libpathod | |
| parent | 2ebe994375976720e80e5fe011a56dda278da3d7 (diff) | |
| download | mitmproxy-6122f2da444e114091d6aec8e01a43d760503d06.tar.gz mitmproxy-6122f2da444e114091d6aec8e01a43d760503d06.tar.bz2 mitmproxy-6122f2da444e114091d6aec8e01a43d760503d06.zip | |
Change test API to allow multiple pathoc requests
Add simple unit test for websocket server
Diffstat (limited to 'libpathod')
| -rw-r--r-- | libpathod/pathod.py | 9 | ||||
| -rw-r--r-- | libpathod/test.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py index 56348fbb..c5ad942a 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -103,8 +103,15 @@ class PathodHandler(tcp.BaseHandler): while True: try: frm = websockets.Frame.from_file(self.rfile) + retlog = dict( + type="wsframe", + frame=dict( + ), + cipher=None, + ) + self.addlog(retlog) break - except tcp.NetLibTimeout: + except tcp.NetLibTimeout: # pragma: no cover pass lg(frm.human_readable()) return self.handle_websocket, None diff --git a/libpathod/test.py b/libpathod/test.py index afd41f81..596fea9c 100644 --- a/libpathod/test.py +++ b/libpathod/test.py @@ -48,7 +48,7 @@ class Daemon: l = self.log() if not l: return None - return l[-1] + return l[0] def log(self): """ |
