Skip to content
Myr

Fixed response repr. (#101)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Fixed response repr. * Fixed response repr tests.

authored by updatatoday · committed by Tom Christie · parent 9930de8 · Browse files · 4 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+4 added−4 removed

  • tests:+3 added−3 removed
  • other:+1 added−1 removed

4 files+4 added−4 removed

modified:http3/models.py+1 added-1 removed
811 unmodified lines
812 self._cookies.extract_cookies(self)813 return self._cookies814815 def __repr__(self) -> str:816 return f"<Response [{self.status_code} {self.reason_phrase}])>"816 return f"<Response [{self.status_code} {self.reason_phrase}]>"817818819class AsyncResponse(BaseResponse):820 def __init__(
329 unmodified lines
modified:tests/client/test_async_client.py+1 added-1 removed
10 unmodified lines
11 assert response.status_code == 20012 assert response.text == "Hello, world!"13 assert response.protocol == "HTTP/1.1"14 assert response.headers15 assert repr(response) == "<Response [200 OK])>"15 assert repr(response) == "<Response [200 OK]>"161718@pytest.mark.asyncio19async def test_post(server):
115 unmodified lines
modified:tests/client/test_client.py+1 added-1 removed
35 unmodified lines
36 assert response.encoding == "iso-8859-1"37 assert response.request.url == http3.URL(url)38 assert response.headers39 assert response.is_redirect is False40 assert repr(response) == "<Response [200 OK])>"40 assert repr(response) == "<Response [200 OK]>"414243@threadpool44def test_post(server):
108 unmodified lines
modified:tests/models/test_responses.py+1 added-1 removed
20 unmodified lines
212223def test_response_repr():24 response = http3.Response(200, content=b"Hello, world!")25 assert repr(response) == "<Response [200 OK])>"25 assert repr(response) == "<Response [200 OK]>"262728def test_response_content_type_encoding():29 """
223 unmodified lines