aboutsummaryrefslogtreecommitdiffstats
path: root/test/tutils.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-01-05 20:29:46 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-01-05 20:29:46 +1300
commit5493925ea07aabc569d0f6cddffff49fda59383c (patch)
tree1d62dbecab9c97ad1de1349157c1e2dc83fb8121 /test/tutils.py
parentc744ef2dcbb95182668ed8897542029c6c6734b9 (diff)
downloadmitmproxy-5493925ea07aabc569d0f6cddffff49fda59383c.tar.gz
mitmproxy-5493925ea07aabc569d0f6cddffff49fda59383c.tar.bz2
mitmproxy-5493925ea07aabc569d0f6cddffff49fda59383c.zip
CONNECT through proxy mode for pathoc
Also, use this to unit test the pathod CONNECT implementation.
Diffstat (limited to 'test/tutils.py')
-rw-r--r--test/tutils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/tutils.py b/test/tutils.py
index 0a5455a3..580174d9 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -44,11 +44,11 @@ class DaemonTests:
def get(self, spec):
return requests.get(self.d.p(spec), verify=False)
- def pathoc(self, spec, timeout=None):
- c = pathoc.Pathoc("localhost", self.d.port)
- c.connect()
- if self.ssl:
- c.convert_to_ssl()
+ def pathoc(self, spec, timeout=None, connect_to=None, ssl=None):
+ if ssl is None:
+ ssl = self.ssl
+ c = pathoc.Pathoc("localhost", self.d.port, ssl=ssl)
+ c.connect(connect_to)
if timeout:
c.settimeout(timeout)
return c.request(spec)