'Test that channel request messages are sent in the right format.'

def test_sendRequest(self):

    channel = TestChannel()
    self._openChannel(channel)
    d = self.conn.sendRequest(channel, 'test', 'test', True)
    d.addErrback((lambda failure: None))
    self.conn.sendRequest(channel, 'test2', '', False)
    channel.localClosed = True
    self.conn.sendRequest(channel, 'test3', '', True)
    self.assertEqual(self.transport.packets, [(connection.MSG_CHANNEL_REQUEST, (('\x00\x00\x00\xff' + common.NS('test')) + '\x01test')), (connection.MSG_CHANNEL_REQUEST, (('\x00\x00\x00\xff' + common.NS('test2')) + '\x00'))])
    self.assertEqual(self.conn.deferreds[0], [d])
