':py:obj:`Connection.shutdown` performs an SSL-level connection shutdown.'

def test_shutdown(self):

    (server, client) = self._loopback()
    self.assertFalse(server.shutdown())
    self.assertEquals(server.get_shutdown(), SENT_SHUTDOWN)
    self.assertRaises(ZeroReturnError, client.recv, 1024)
    self.assertEquals(client.get_shutdown(), RECEIVED_SHUTDOWN)
    client.shutdown()
    self.assertEquals(client.get_shutdown(), (SENT_SHUTDOWN | RECEIVED_SHUTDOWN))
    self.assertRaises(ZeroReturnError, server.recv, 1024)
    self.assertEquals(server.get_shutdown(), (SENT_SHUTDOWN | RECEIVED_SHUTDOWN))
