From 8d8ede7e265591e94f6e2db5bf79f6b85e822912 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 22 Jul 2012 12:30:10 +1200 Subject: Handle invalid content length headers. --- test/test_pathod.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_pathod.py b/test/test_pathod.py index 1484efcd..86f37f01 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -1,6 +1,6 @@ import requests from libpathod import pathod, test, version, pathoc -from netlib import tcp +from netlib import tcp, http import tutils class _TestApplication: @@ -115,6 +115,12 @@ class _DaemonTests: assert l["type"] == "error" assert "foo" in l["msg"] + def test_invalid_body(self): + tutils.raises(http.HttpError, self.pathoc, "get:/:h'content-length'='foo'") + l = self.d.log()[0] + assert l["type"] == "error" + assert "Invalid" in l["msg"] + class TestDaemon(_DaemonTests): -- cgit v1.2.3