diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_server.py | 16 | ||||
-rw-r--r-- | test/tutils.py | 4 |
2 files changed, 14 insertions, 6 deletions
diff --git a/test/test_server.py b/test/test_server.py index e6f055cc..d0e5d652 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -3,9 +3,17 @@ import time import libpathod.test, requests import tutils +""" + Note that the choice of response code in these tests matters more than you + might think. libcurl treats a 304 response code differently from, say, a + 200 response code - it will correctly terminate a 304 response with no + content-length header, whereas it will block forever waiting for content + for a 200 response. +""" + class Sanity(tutils.ProxTest): def test_http(self): - assert self.pathod("205").status_code == 205 + assert self.pathod("304").status_code == 304 assert self.log() @@ -23,10 +31,10 @@ class TestReverse(Sanity): class TestProxy(tutils.ProxTest): def test_http(self): - f = self.pathod("205") - assert f.status_code == 205 + f = self.pathod("304") + assert f.status_code == 304 l = self.log() assert l[0].address assert "host" in l[1].headers - assert l[2].code == 205 + assert l[2].code == 304 diff --git a/test/tutils.py b/test/tutils.py index 7852a8b8..849b9413 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -121,7 +121,7 @@ class ProxTest: r = hurl.get( "http://127.0.0.1:%s"%self.proxy.port + "/p/" + spec, validate_cert=False, - #debug=hurl.utils.stdout_debug + debug=hurl.utils.stdout_debug ) return r else: @@ -129,7 +129,7 @@ class ProxTest: self.urlbase + "/p/" + spec, proxy=self.proxies, validate_cert=False, - #debug=hurl.utils.stdout_debug + debug=hurl.utils.stdout_debug ) @property |