'Test that channel requests that fail send MSG_CHANNEL_FAILURE.'

def test_CHANNEL_REQUEST_failure(self):

    channel = TestChannel()
    self._openChannel(channel)
    d = self.conn.ssh_CHANNEL_REQUEST((('\x00\x00\x00\x00' + common.NS('test')) + '\xff'))
    def check(result):
        self.assertEqual(self.transport.packets, [(connection.MSG_CHANNEL_FAILURE, '\x00\x00\x00\xff')])
    d.addCallback(self.fail)
    d.addErrback(check)
    return d
