MCPcopy Index your code
hub / github.com/python/cpython / test_epipe

Method test_epipe

Lib/test/test_httplib.py:1293–1306  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

requestMethod · 0.95
getresponseMethod · 0.95
EPipeSocketClass · 0.85
getheaderMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected