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

def test_sendClose(self):

    channel = TestChannel()
    self._openChannel(channel)
    self.conn.sendClose(channel)
    self.assertTrue(channel.localClosed)
    self.assertEqual(self.transport.packets, [(connection.MSG_CHANNEL_CLOSE, '\x00\x00\x00\xff')])
    self.conn.sendClose(channel)
    self.assertEqual(self.transport.packets, [(connection.MSG_CHANNEL_CLOSE, '\x00\x00\x00\xff')])
    channel2 = TestChannel()
    self._openChannel(channel2)
    channel2.remoteClosed = True
    self.conn.sendClose(channel2)
    self.assertTrue(channel2.gotClosed)
