'After L{SSHTransportBase.sendKexInit} has been called, messages types
other than the following are queued and not sent until after I{NEWKEYS}
is sent by L{SSHTransportBase._keySetup}.
RFC 4253, section 7.1.'

def test_sendKexInitBlocksOthers(self):

    disallowedMessageTypes = [transport.MSG_SERVICE_REQUEST, transport.MSG_KEXINIT]
    self.transport.clear()
    del self.proto.sendPacket
    for messageType in disallowedMessageTypes:
        self.proto.sendPacket(messageType, 'foo')
        self.assertEqual(self.transport.value(), '')
    self.finishKeyExchange(self.proto)
    self.proto.nextEncryptions = MockCipher()
    self.proto._newKeys()
    self.assertEqual(self.transport.value().count('foo'), 2)
