'Test that the KEXINIT (key exchange initiation) message is sent
correctly.  Payload::
bytes[16] cookie
string key exchange algorithms
string public key algorithms
string outgoing ciphers
string incoming ciphers
string outgoing MACs
string incoming MACs
string outgoing compressions
string incoming compressions
bool first packet follows
uint32 0'

def test_sendKexInit(self):

    value = self.transport.value().split('\r\n', 1)[1]
    self.proto.buf = value
    packet = self.proto.getPacket()
    self.assertEqual(packet[0:1], chr(transport.MSG_KEXINIT))
    self.assertEqual(packet[1:17], ('\x99' * 16))
    (keyExchanges, pubkeys, ciphers1, ciphers2, macs1, macs2, compressions1, compressions2, languages1, languages2, buf) = common.getNS(packet[17:], 10)
    self.assertEqual(keyExchanges, ','.join(self.proto.supportedKeyExchanges))
    self.assertEqual(pubkeys, ','.join(self.proto.supportedPublicKeys))
    self.assertEqual(ciphers1, ','.join(self.proto.supportedCiphers))
    self.assertEqual(ciphers2, ','.join(self.proto.supportedCiphers))
    self.assertEqual(macs1, ','.join(self.proto.supportedMACs))
    self.assertEqual(macs2, ','.join(self.proto.supportedMACs))
    self.assertEqual(compressions1, ','.join(self.proto.supportedCompressions))
    self.assertEqual(compressions2, ','.join(self.proto.supportedCompressions))
    self.assertEqual(languages1, ','.join(self.proto.supportedLanguages))
    self.assertEqual(languages2, ','.join(self.proto.supportedLanguages))
    self.assertEqual(buf, ('\x00' * 5))
