(self)
| 1291 | self.fail('IncompleteRead expected') |
| 1292 | |
| 1293 | def test_epipe(self): |
| 1294 | sock = EPipeSocket( |
| 1295 | "HTTP/1.0 401 Authorization Required\r\n" |
| 1296 | "Content-type: text/html\r\n" |
| 1297 | "WWW-Authenticate: Basic realm=\"example\"\r\n", |
| 1298 | b"Content-Length") |
| 1299 | conn = client.HTTPConnection("example.com") |
| 1300 | conn.sock = sock |
| 1301 | self.assertRaises(OSError, |
| 1302 | lambda: conn.request("PUT", "/url", "body")) |
| 1303 | resp = conn.getresponse() |
| 1304 | self.assertEqual(401, resp.status) |
| 1305 | self.assertEqual("Basic realm=\"example\"", |
| 1306 | resp.getheader("www-authenticate")) |
| 1307 | |
| 1308 | # Test lines overflowing the max line size (_MAXLINE in http.client) |
| 1309 |
nothing calls this directly
no test coverage detected