aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-24 16:38:32 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-24 16:38:32 +1200
commit4fc64ac04ffbec8e3a51ea3f7a129f17530ee3ef (patch)
tree377ad164d9bb860ddba4fc1b1134828f38feebed /test
parente6aa9ff67582c00d2de03f65b47dd776cd602fb7 (diff)
downloadmitmproxy-4fc64ac04ffbec8e3a51ea3f7a129f17530ee3ef.tar.gz
mitmproxy-4fc64ac04ffbec8e3a51ea3f7a129f17530ee3ef.tar.bz2
mitmproxy-4fc64ac04ffbec8e3a51ea3f7a129f17530ee3ef.zip
Enable anchors on command line.
Diffstat (limited to 'test')
-rw-r--r--test/test_pathod.py3
-rw-r--r--test/test_utils.py6
2 files changed, 5 insertions, 4 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py
index e00694cd..4073926f 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -1,4 +1,5 @@
from libpathod import pathod
+import tutils
class _TestApplication:
def test_anchors(self):
@@ -20,6 +21,8 @@ class TestPathod:
anchors = [(".*", "200")]
)
assert p.anchors
+ tutils.raises("invalid regex", pathod.Pathod, ("127.0.0.1", 0), anchors=[("*", "200")])
+ tutils.raises("invalid page spec", pathod.Pathod, ("127.0.0.1", 0), anchors=[("foo", "bar")])
def test_logging(self):
p = pathod.Pathod(("127.0.0.1", 0))
diff --git a/test/test_utils.py b/test/test_utils.py
index 5cd0fd3d..72c892f0 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -3,10 +3,8 @@ import tutils
def test_parse_anchor_spec():
- assert utils.parse_anchor_spec("foo=200", {}) == ("foo", "200")
- tutils.raises(utils.AnchorError, utils.parse_anchor_spec, "foobar", {})
- tutils.raises(utils.AnchorError, utils.parse_anchor_spec, "*=200", {})
- tutils.raises(utils.AnchorError, utils.parse_anchor_spec, "foo=bar", {})
+ assert utils.parse_anchor_spec("foo=200") == ("foo", "200")
+ assert utils.parse_anchor_spec("foo") == None
def test_data_path():