aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-07-30 13:52:40 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-07-30 13:52:40 +1200
commite26aac1d3c6e4ca9f09cffa9d61d5a632dc35f14 (patch)
treeba18dbb0801386d831ddb97413214dc08721c46a /test
parent43314c77c8786367d4a52a55f642dd3d578a2a2b (diff)
downloadmitmproxy-e26aac1d3c6e4ca9f09cffa9d61d5a632dc35f14.tar.gz
mitmproxy-e26aac1d3c6e4ca9f09cffa9d61d5a632dc35f14.tar.bz2
mitmproxy-e26aac1d3c6e4ca9f09cffa9d61d5a632dc35f14.zip
100% test coverage.
Diffstat (limited to 'test')
-rw-r--r--test/test_pathoc.py1
-rw-r--r--test/test_pathod.py6
2 files changed, 7 insertions, 0 deletions
diff --git a/test/test_pathoc.py b/test/test_pathoc.py
index 3cd07649..397a7f0e 100644
--- a/test/test_pathoc.py
+++ b/test/test_pathoc.py
@@ -57,3 +57,4 @@ class TestDaemon:
d = tutils.test_data.path("data/request")
assert "foo" in self.tval(["+%s"%d])
assert "File" in self.tval(["+/nonexistent"])
+
diff --git a/test/test_pathod.py b/test/test_pathod.py
index d6e2e886..8bc896d3 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -107,6 +107,12 @@ class CommonTests(tutils.DaemonTests):
assert l["type"] == "error"
assert "Invalid" in l["msg"]
+ def test_invalid_headers(self):
+ tutils.raises(http.HttpError, self.pathoc, "get:/:h'\t'='foo'")
+ l = self.d.log()[0]
+ assert l["type"] == "error"
+ assert "Invalid headers" in l["msg"]
+
def test_access_denied(self):
rsp = self.get("=nonexistent")
assert rsp.status_code == 800