From 9ec5798c0d17f0858229dd800955abab4fa803fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 24 Aug 2024 11:47:58 -0700 Subject: [PATCH] fix tests with Twisted 24.7.0 (#526) In the fixed test cases the responses now contain `HTTP/1.1` rather than `HTTP/1.0`. --- tests/test_http_request.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_http_request.py b/tests/test_http_request.py index dca5bd7..f0fe376 100644 --- a/tests/test_http_request.py +++ b/tests/test_http_request.py @@ -304,12 +304,12 @@ class TestHTTPRequest(DaphneTestCase): response = self.run_daphne_raw( b"GET /\xc3\xa4\xc3\xb6\xc3\xbc HTTP/1.0\r\n\r\n" ) - self.assertTrue(response.startswith(b"HTTP/1.0 400 Bad Request")) + self.assertTrue(b"400 Bad Request" in response) # Bad querystring response = self.run_daphne_raw( b"GET /?\xc3\xa4\xc3\xb6\xc3\xbc HTTP/1.0\r\n\r\n" ) - self.assertTrue(response.startswith(b"HTTP/1.0 400 Bad Request")) + self.assertTrue(b"400 Bad Request" in response) def test_invalid_header_name(self): """ @@ -321,4 +321,4 @@ class TestHTTPRequest(DaphneTestCase): response = self.run_daphne_raw( f"GET / HTTP/1.0\r\n{header_name}: baz\r\n\r\n".encode("ascii") ) - self.assertTrue(response.startswith(b"HTTP/1.0 400 Bad Request")) + self.assertTrue(b"400 Bad Request" in response)