'Test that NEWKEYS transitions the keys in nextEncryptions to
currentEncryptions.'

def test_NEWKEYS(self):

    self.test_KEXINITMultipleAlgorithms()
    self.proto.nextEncryptions = transport.SSHCiphers('none', 'none', 'none', 'none')
    self.proto.ssh_NEWKEYS('')
    self.assertIs(self.proto.currentEncryptions, self.proto.nextEncryptions)
    self.assertIsNone(self.proto.outgoingCompression)
    self.assertIsNone(self.proto.incomingCompression)
    self.proto.outgoingCompressionType = 'zlib'
    self.simulateKeyExchange('AB', 'CD')
    self.proto.ssh_NEWKEYS('')
    self.assertIsNotNone(self.proto.outgoingCompression)
    self.proto.incomingCompressionType = 'zlib'
    self.simulateKeyExchange('AB', 'EF')
    self.proto.ssh_NEWKEYS('')
    self.assertIsNotNone(self.proto.incomingCompression)
