From c7b5faf7dbaab518bbe9942f018861f738ebb2b0 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 23 Jul 2012 14:37:00 +1200 Subject: Add hooks for policy checks of served data. --- test/test_rparse.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/test_rparse.py') diff --git a/test/test_rparse.py b/test/test_rparse.py index 0cb3e373..929d7342 100644 --- a/test/test_rparse.py +++ b/test/test_rparse.py @@ -419,6 +419,13 @@ class TestResponse: assert r.body[:] assert str(r) + def test_checkfunc(self): + s = cStringIO.StringIO() + r = rparse.parse_response({}, "400:b@100k") + def check(req, acts): + return "errmsg" + assert r.serve(s, check=check)["error"] == "errmsg" + def test_render(self): s = cStringIO.StringIO() r = rparse.parse_response({}, "400'msg'") -- cgit v1.2.3