(self)
| 1245 | self.fail('IncompleteRead expected') |
| 1246 | |
| 1247 | def test_epipe(self): |
| 1248 | sock = EPipeSocket( |
| 1249 | "HTTP/1.0 401 Authorization Required\r\n" |
| 1250 | "Content-type: text/html\r\n" |
| 1251 | "WWW-Authenticate: Basic realm=\"example\"\r\n", |
| 1252 | b"Content-Length") |
| 1253 | conn = client.HTTPConnection("example.com") |
| 1254 | conn.sock = sock |
| 1255 | self.assertRaises(OSError, |
| 1256 | lambda: conn.request("PUT", "/url", "body")) |
| 1257 | resp = conn.getresponse() |
| 1258 | self.assertEqual(401, resp.status) |
| 1259 | self.assertEqual("Basic realm=\"example\"", |
| 1260 | resp.getheader("www-authenticate")) |
| 1261 | |
| 1262 | # Test lines overflowing the max line size (_MAXLINE in http.client) |
| 1263 |
nothing calls this directly
no test coverage detected