Test that a connection can be reused after calling `drain_conn` on an unread response.
(pool: HTTPConnectionPool)
| 141 | |
| 142 | |
| 143 | def test_response_after_drain_conn(pool: HTTPConnectionPool) -> None: |
| 144 | """ |
| 145 | Test that a connection can be reused after calling `drain_conn` on |
| 146 | an unread response. |
| 147 | """ |
| 148 | conn = pool._get_conn() |
| 149 | |
| 150 | conn.request("GET", "/", preload_content=False) |
| 151 | response = conn.getresponse() |
| 152 | assert response.status == 200 |
| 153 | response.drain_conn() |
| 154 | |
| 155 | conn.request("GET", "/", preload_content=False) |
| 156 | response = conn.getresponse() |
| 157 | assert response.status == 200 |
| 158 | |
| 159 | conn.close() |
nothing calls this directly
no test coverage detected