def test_closed(self):
"""
If the underlying socket is closed, :py:obj:`Connection.sendall` propagates the
write error from the low level write call.
"""
server, client = self._loopback()
server.sock_shutdown(2)
exc = self.assertRaises(SysCallError, server.sendall, b"hello, world")
if platform == "win32":
self.assertEqual(exc.args[0], ESHUTDOWN)
else:
self.assertEqual(exc.args[0], EPIPE)
评论列表
文章目录