Test the connection is cleaned up after an invalid response
(self)
| 1854 | "Connection not closed with {!r}".format(transfer)) |
| 1855 | |
| 1856 | def test_invalid_closed(self): |
| 1857 | """Test the connection is cleaned up after an invalid response""" |
| 1858 | conn = test_urllib.fakehttp(b"") |
| 1859 | handler = urllib.request.AbstractHTTPHandler() |
| 1860 | req = Request("http://dummy/") |
| 1861 | req.timeout = None |
| 1862 | with self.assertRaises(http.client.BadStatusLine): |
| 1863 | handler.do_open(conn, req) |
| 1864 | self.assertTrue(conn.fakesock.closed, "Connection not closed") |
| 1865 | |
| 1866 | |
| 1867 | class MiscTests(unittest.TestCase): |
nothing calls this directly
no test coverage detected