aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-01-26 16:50:17 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-01-26 16:50:17 +1300
commit635f7a971d4bb815c8963ac52187b0c0f4f143d7 (patch)
tree156056512254edb05d435703ba15c94a3c3aa7c0 /test
parent29d800767802ffc17c3577aaebfaf59221e0fb7e (diff)
downloadmitmproxy-635f7a971d4bb815c8963ac52187b0c0f4f143d7.tar.gz
mitmproxy-635f7a971d4bb815c8963ac52187b0c0f4f143d7.tar.bz2
mitmproxy-635f7a971d4bb815c8963ac52187b0c0f4f143d7.zip
Add saving and loading of complete flows for later replay and analysis.
Diffstat (limited to 'test')
-rw-r--r--test/test_console.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test_console.py b/test/test_console.py
index 399cc485..c5c856f8 100644
--- a/test/test_console.py
+++ b/test/test_console.py
@@ -57,7 +57,6 @@ class uState(libpry.AutoTree):
resp = tresp(req)
assert c.add_response(resp)
assert len(c.flow_list) == 1
- assert f.waiting == False
assert c.lookup(resp)
newresp = tresp()
@@ -183,6 +182,20 @@ class uState(libpry.AutoTree):
c.clear()
assert len(c.flow_list) == 0
+ def test_dump_flows(self):
+ c = console.ConsoleState()
+ self._add_request(c)
+ self._add_response(c)
+ self._add_request(c)
+ self._add_response(c)
+ self._add_request(c)
+ self._add_response(c)
+
+ dump = c.dump_flows()
+ c.clear()
+ c.load_flows(dump, console.ConsoleFlow)
+ assert isinstance(c.flow_list[0], console.ConsoleFlow)
+
class uFlow(libpry.AutoTree):
def test_match(self):