aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-16 16:43:35 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-16 16:43:35 +1300
commit66349c97836c5885919f9fd2bce75ddd04bfc39a (patch)
treea5d170848515d8b293de80c196760848552308ed /test
parent27f0765cdd6bb29fe1dd00aaa24b17ae50888368 (diff)
downloadmitmproxy-66349c97836c5885919f9fd2bce75ddd04bfc39a.tar.gz
mitmproxy-66349c97836c5885919f9fd2bce75ddd04bfc39a.tar.bz2
mitmproxy-66349c97836c5885919f9fd2bce75ddd04bfc39a.zip
FlowMaster bugfixes and unit tests.
Diffstat (limited to 'test')
-rw-r--r--test/test_flow.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/test_flow.py b/test/test_flow.py
index 7db564b2..7354061b 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -261,10 +261,28 @@ class uSerialize(libpry.AutoTree):
assert l[0] == f
-
+class uFlowMaster(libpry.AutoTree):
+ def test_one(self):
+ s = flow.State()
+ f = flow.FlowMaster(None, s)
+
+ req = utils.treq()
+ f.handle_clientconnection(req.client_conn)
+ assert len(s.flow_list) == 1
+ f.handle_request(req)
+ assert len(s.flow_list) == 1
+ f.handle_request(req)
+ resp = utils.tresp()
+ resp.request = req
+ f.handle_response(resp)
+ assert len(s.flow_list) == 1
+
+
tests = [
uFlow(),
uState(),
- uSerialize()
+ uSerialize(),
+ uFlowMaster()
+
]