diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-11-11 12:29:34 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-11-11 12:29:34 +0100 |
commit | 8635e00175117d8574b4bea5edc1c43528ddf3e9 (patch) | |
tree | 1be23a6349a8fb81a89f8417b0b9d236d1829639 /test/tutils.py | |
parent | b917b61e6aead4f353ef15838315ecc0df721e29 (diff) | |
parent | 27c7e9e9345bbc458e7efc4093c2074e19011d12 (diff) | |
download | mitmproxy-8635e00175117d8574b4bea5edc1c43528ddf3e9.tar.gz mitmproxy-8635e00175117d8574b4bea5edc1c43528ddf3e9.tar.bz2 mitmproxy-8635e00175117d8574b4bea5edc1c43528ddf3e9.zip |
Merge remote-tracking branch 'origin/master'
Conflicts:
setup.py
Diffstat (limited to 'test/tutils.py')
-rw-r--r-- | test/tutils.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/test/tutils.py b/test/tutils.py index 2c3a2c9d..5876e5e6 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -1,8 +1,12 @@ -import tempfile, os, shutil +import tempfile +import os +import re +import shutil from contextlib import contextmanager -from libpathod import utils, test, pathoc, pathod +from libpathod import utils, test, pathoc, pathod, language import requests + class DaemonTests: noweb = False noapi = False @@ -11,6 +15,7 @@ class DaemonTests: timeout = None hexdump = False ssloptions = None + @classmethod def setUpAll(self): opts = self.ssloptions or {} @@ -19,7 +24,9 @@ class DaemonTests: so = pathod.SSLOptions(**opts) self.d = test.Daemon( staticdir=test_data.path("data"), - anchors=[("/anchor/.*", "202:da")], + anchors=[ + (re.compile("/anchor/.*"), language.parse_response("202:da")) + ], ssl = self.ssl, ssloptions = so, sizelimit=1*1024*1024, @@ -45,7 +52,13 @@ class DaemonTests: def getpath(self, path, params=None): scheme = "https" if self.ssl else "http" return requests.get( - "%s://localhost:%s/%s"%(scheme, self.d.port, path), verify=False, params=params + "%s://localhost:%s/%s"%( + scheme, + self.d.port, + path + ), + verify=False, + params=params ) def get(self, spec): |