MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_epipe

Method test_epipe

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

Source from the content-addressed store, hash-verified

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

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