Test the connection is cleaned up after an invalid response
(self)
| 1837 | "Connection not closed with {!r}".format(transfer)) |
| 1838 | |
| 1839 | def test_invalid_closed(self): |
| 1840 | """Test the connection is cleaned up after an invalid response""" |
| 1841 | conn = test_urllib.fakehttp(b"") |
| 1842 | handler = urllib.request.AbstractHTTPHandler() |
| 1843 | req = Request("http://dummy/") |
| 1844 | req.timeout = None |
| 1845 | with self.assertRaises(http.client.BadStatusLine): |
| 1846 | handler.do_open(conn, req) |
| 1847 | self.assertTrue(conn.fakesock.closed, "Connection not closed") |
| 1848 | |
| 1849 | |
| 1850 | class MiscTests(unittest.TestCase): |
nothing calls this directly
no test coverage detected