diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-10-25 15:30:54 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-10-25 15:30:54 +1300 |
commit | 00d0ee5ad56d8243b1e9bfffec9a941e11359d2c (patch) | |
tree | db51a4a1636249ff793b3618f28df5075473cc7e /test/tutils.py | |
parent | d6ee5327112182202513ff6ce62d95df1567fdb6 (diff) | |
download | mitmproxy-00d0ee5ad56d8243b1e9bfffec9a941e11359d2c.tar.gz mitmproxy-00d0ee5ad56d8243b1e9bfffec9a941e11359d2c.tar.bz2 mitmproxy-00d0ee5ad56d8243b1e9bfffec9a941e11359d2c.zip |
Parse patterns eagerly on instantiation
Diffstat (limited to 'test/tutils.py')
-rw-r--r-- | test/tutils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/tutils.py b/test/tutils.py index 94c1ff9d..5876e5e6 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -1,10 +1,12 @@ 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 @@ -22,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, |