diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-23 19:55:33 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-23 19:55:33 +1200 |
commit | 622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd (patch) | |
tree | 8295e8d3b487a605c5051a9abaf16e1840871eae /test/tutils.py | |
parent | eba485f5ebef6975c60eb29e69e03aa7598d59b8 (diff) | |
download | mitmproxy-622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd.tar.gz mitmproxy-622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd.tar.bz2 mitmproxy-622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd.zip |
Add a --noweb option to turn web iface off, refactor unit tests.
Diffstat (limited to 'test/tutils.py')
-rw-r--r-- | test/tutils.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/tutils.py b/test/tutils.py index 3b430825..b1e277e7 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -4,13 +4,16 @@ from libpathod import utils, test, pathoc import requests class DaemonTests: + noweb = False + ssl = False @classmethod def setUpAll(self): self.d = test.Daemon( staticdir=test_data.path("data"), anchors=[("/anchor/.*", "202")], - ssl = self.SSL, - sizelimit=1*1024*1024 + ssl = self.ssl, + sizelimit=1*1024*1024, + noweb = self.noweb ) @classmethod @@ -21,19 +24,19 @@ class DaemonTests: self.d.clear_log() def getpath(self, path, params=None): - scheme = "https" if self.SSL else "http" + scheme = "https" if self.ssl else "http" return requests.get( "%s://localhost:%s/%s"%(scheme, self.d.port, path), verify=False, params=params ) def get(self, spec): - scheme = "https" if self.SSL else "http" + scheme = "https" if self.ssl else "http" return requests.get("%s://localhost:%s/p/%s"%(scheme, self.d.port, spec), verify=False) def pathoc(self, spec, timeout=None): c = pathoc.Pathoc("localhost", self.d.port) c.connect() - if self.SSL: + if self.ssl: c.convert_to_ssl() if timeout: c.settimeout(timeout) |