diff --git a/tests/test_live_rewriter.py b/tests/test_live_rewriter.py index 29f7fae0..1dd44b47 100644 --- a/tests/test_live_rewriter.py +++ b/tests/test_live_rewriter.py @@ -91,25 +91,28 @@ def test_live_head(self, fmod_sl): resp = self.head('/live/{0}httpbin.org/get?foo=bar', fmod_sl) assert resp.status_int == 200 - @pytest.mark.skipif(sys.version_info < (3,0), reason='does not respond in 2.7') - def test_live_bad_content_length(self, fmod_sl): - resp = self.get('/live/{0}httpbin.org/response-headers?content-length=149,149', fmod_sl, status=200) - assert resp.headers['Content-Length'] == '149' - - resp = self.get('/live/{0}httpbin.org/response-headers?Content-Length=xyz', fmod_sl, status=200) - assert resp.headers['Content-Length'] == '90' - - @pytest.mark.skipif(sys.version_info < (3,0), reason='does not respond in 2.7') - def test_live_bad_content_length_with_range(self, fmod_sl): - resp = self.get('/live/{0}httpbin.org/response-headers?content-length=149,149', fmod_sl, - headers={'Range': 'bytes=0-'}, status=206) - assert resp.headers['Content-Length'] == '149' - assert resp.headers['Content-Range'] == 'bytes 0-148/149' - - resp = self.get('/live/{0}httpbin.org/response-headers?Content-Length=xyz', fmod_sl, - headers={'Range': 'bytes=0-'}, status=206) - assert resp.headers['Content-Length'] == '90' - assert resp.headers['Content-Range'] == 'bytes 0-89/90' + # Following tests are temporarily commented out because latest version of PSF httpbin + # now returns 400 if content-length header isn't parsable as an int + + # @pytest.mark.skipif(sys.version_info < (3,0), reason='does not respond in 2.7') + # def test_live_bad_content_length(self, fmod_sl): + # resp = self.get('/live/{0}httpbin.org/response-headers?content-length=149,149', fmod_sl, status=200) + # assert resp.headers['Content-Length'] == '149' + + # resp = self.get('/live/{0}httpbin.org/response-headers?Content-Length=xyz', fmod_sl, status=200) + # assert resp.headers['Content-Length'] == '90' + + # @pytest.mark.skipif(sys.version_info < (3,0), reason='does not respond in 2.7') + # def test_live_bad_content_length_with_range(self, fmod_sl): + # resp = self.get('/live/{0}httpbin.org/response-headers?content-length=149,149', fmod_sl, + # headers={'Range': 'bytes=0-'}, status=206) + # assert resp.headers['Content-Length'] == '149' + # assert resp.headers['Content-Range'] == 'bytes 0-148/149' + + # resp = self.get('/live/{0}httpbin.org/response-headers?Content-Length=xyz', fmod_sl, + # headers={'Range': 'bytes=0-'}, status=206) + # assert resp.headers['Content-Length'] == '90' + # assert resp.headers['Content-Range'] == 'bytes 0-89/90' def test_custom_unicode_header(self, fmod_sl): value = u'⛄'