]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Fixed response repr. (#101)
authorupdatatoday <50987269+updatatoday@users.noreply.github.com>
Sun, 23 Jun 2019 10:37:00 +0000 (13:37 +0300)
committerTom Christie <tom@tomchristie.com>
Sun, 23 Jun 2019 10:37:00 +0000 (11:37 +0100)
* Fixed response repr.

* Fixed response repr tests.

http3/models.py
tests/client/test_async_client.py
tests/client/test_client.py
tests/models/test_responses.py

index bd3333a1e464779b9077b4b7ae524cd15fe281e5..02fc0ddb6a279f72dd8ef1ff0c28853a53adda88 100644 (file)
@@ -813,7 +813,7 @@ class BaseResponse:
         return self._cookies
 
     def __repr__(self) -> str:
-        return f"<Response [{self.status_code} {self.reason_phrase}])>"
+        return f"<Response [{self.status_code} {self.reason_phrase}]>"
 
 
 class AsyncResponse(BaseResponse):
index 443ca22d519697b59217533f3ace069c7ea6208c..3f5bf53a2bf66f240b46537aaee1eb9b21feaa78 100644 (file)
@@ -12,7 +12,7 @@ async def test_get(server):
     assert response.text == "Hello, world!"
     assert response.protocol == "HTTP/1.1"
     assert response.headers
-    assert repr(response) == "<Response [200 OK])>"
+    assert repr(response) == "<Response [200 OK]>"
 
 
 @pytest.mark.asyncio
index 4e52c6f89ec62b507f4f3ee195e2c0618492ea76..0ab2c83fb9cddaa884876f3f760021475bd710a4 100644 (file)
@@ -37,7 +37,7 @@ def test_get(server):
     assert response.request.url == http3.URL(url)
     assert response.headers
     assert response.is_redirect is False
-    assert repr(response) == "<Response [200 OK])>"
+    assert repr(response) == "<Response [200 OK]>"
 
 
 @threadpool
index 6bff37f664730a0559c1deb0ddca6691186a947f..31aa2310a0907ad7e5ff36a266921ea0e7cac71e 100644 (file)
@@ -22,7 +22,7 @@ def test_response():
 
 def test_response_repr():
     response = http3.Response(200, content=b"Hello, world!")
-    assert repr(response) == "<Response [200 OK])>"
+    assert repr(response) == "<Response [200 OK]>"
 
 
 def test_response_content_type_encoding():