aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_flow.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-03-06 16:02:28 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-03-06 16:02:28 +1300
commit42ffded6268401fef1f3ea0f748f92ff264674a2 (patch)
tree27207455e96e7052d9b874be352a003b57aaca28 /test/test_flow.py
parent4f02480482cec13d36ed9b216784c3136e047192 (diff)
downloadmitmproxy-42ffded6268401fef1f3ea0f748f92ff264674a2.tar.gz
mitmproxy-42ffded6268401fef1f3ea0f748f92ff264674a2.tar.bz2
mitmproxy-42ffded6268401fef1f3ea0f748f92ff264674a2.zip
Bump unit tests, rearrange mitmdump command-line options slightly.
Diffstat (limited to 'test/test_flow.py')
-rw-r--r--test/test_flow.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/test_flow.py b/test/test_flow.py
index 0969cc16..6b0c7bf7 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -1,3 +1,4 @@
+import Queue
from cStringIO import StringIO
from libmproxy import console, proxy, filt, flow
import tutils
@@ -375,6 +376,23 @@ class uFlowMaster(libpry.AutoTree):
err = proxy.Error(f.request, "msg")
fm.handle_error(err)
+ def test_client_playback(self):
+ s = flow.State()
+
+ f = tutils.tflow_full()
+ pb = [tutils.tflow_full(), f]
+ fm = flow.FlowMaster(None, s)
+ assert not fm.start_server_playback(pb, False, [])
+ assert not fm.start_client_playback(pb)
+
+ q = Queue.Queue()
+ assert not fm.state.flow_map
+ fm.tick(q)
+ assert fm.state.flow_map
+
+ fm.handle_error(proxy.Error(f.request, "error"))
+
+
def test_server_playback(self):
s = flow.State()
@@ -393,12 +411,6 @@ class uFlowMaster(libpry.AutoTree):
r.request.content = "gibble"
assert not fm.do_server_playback(r)
- def test_client_playback(self):
- s = flow.State()
- fm = flow.FlowMaster(None, s)
- pb = [tutils.tflow_full()]
- fm.start_client_playback(pb)
-
def test_stickycookie(self):
s = flow.State()
fm = flow.FlowMaster(None, s)