'Deliver a request for a channel open which will result in an exception
being raised during channel lookup.  Assert that an error response is
delivered as a result.'

def _lookupChannelErrorTest(self, code):

    self.transport.avatar._ARGS_ERROR_CODE = code
    self.conn.ssh_CHANNEL_OPEN((common.NS('conch-error-args') + ('\x00\x00\x00\x01' * 4)))
    errors = self.flushLoggedErrors(error.ConchError)
    self.assertEqual(len(errors), 1, ('Expected    one    error,    got:    %r' % (errors,)))
    self.assertEqual(errors[0].value.args, (long(123), 'error    args    in    wrong    order'))
    self.assertEqual(self.transport.packets, [(connection.MSG_CHANNEL_OPEN_FAILURE, (('\x00\x00\x00\x01\x00\x00\x00{' + common.NS('error    args    in    wrong    order')) + common.NS('')))])
