'Failed hostname resolution on a SOCKSv4a packet results in a 91 error
response and the connection getting closed.'

def test_socks4aFailedResolution(self):

    clientRequest = (((struct.pack('!BBH', 4, 1, 34) + socket.inet_aton('0.0.0.1')) + 'fooBAZ\x00') + 'failinghost\x00')
    for byte in iterbytes(clientRequest):
        self.sock.dataReceived(byte)
    sent = self.sock.transport.value()
    self.assertEqual(sent, (struct.pack('!BBH', 0, 91, 0) + socket.inet_aton('0.0.0.0')))
    self.assertTrue(self.sock.transport.stringTCPTransport_closing)
    self.assertIsNone(self.sock.driver_outgoing)
