aboutsummaryrefslogtreecommitdiffstats
path: root/test/tutils.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-05-15 11:22:35 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-05-15 11:22:35 +1200
commit613e9a298ec2fc82a4811c35f806d129ff883f2a (patch)
tree7c505738f11353fd3d8dff7cedd270f063299725 /test/tutils.py
parent6175d92583f564d85ff8a59656977e6372f9dc09 (diff)
downloadmitmproxy-613e9a298ec2fc82a4811c35f806d129ff883f2a.tar.gz
mitmproxy-613e9a298ec2fc82a4811c35f806d129ff883f2a.tar.bz2
mitmproxy-613e9a298ec2fc82a4811c35f806d129ff883f2a.zip
Add a new flow loading mechanism.
We now simulate the normal connection flow when we load flows. That means that we can run scripts, hooks, sticky cookies, etc.
Diffstat (limited to 'test/tutils.py')
-rw-r--r--test/tutils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/tutils.py b/test/tutils.py
index fea7f224..2327bdb9 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -32,6 +32,13 @@ def tflow_full():
return f
+def tflow_err():
+ r = treq()
+ f = flow.Flow(r)
+ f.error = proxy.Error(r, "error")
+ return f
+
+
# Yes, the random ports are horrible. During development, sockets are often not
# properly closed during error conditions, which means you have to wait until
# you can re-bind to the same port. This is a pain in the ass, so we just pick