From 1c45f5b05c7e066c28dfd4c9d1cde3b794f8983c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 23 Jul 2012 15:03:56 +1200 Subject: Use policy hook to apply a size limit in pathod, add corresponding cmdline arg. --- test/test_pathod.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/test_pathod.py') diff --git a/test/test_pathod.py b/test/test_pathod.py index d917e25c..8e1e7490 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -46,7 +46,8 @@ class _DaemonTests: self.d = test.Daemon( staticdir=tutils.test_data.path("data"), anchors=[("/anchor/.*", "202")], - ssl = self.SSL + ssl = self.SSL, + sizelimit=1*1024*1024 ) @classmethod @@ -73,6 +74,12 @@ class _DaemonTests: c.settimeout(timeout) return c.request(spec) + def test_sizelimit(self): + r = self.get("200:b@1g") + assert r.status_code == 800 + l = self.d.log()[0] + assert "too large" in l["response"]["error"] + def test_preline(self): v = self.pathoc(r"get:'/p/200':i0,'\r\n'") assert v[1] == 200 -- cgit v1.2.3