def test_keySetup(self):
        """
        Test that _keySetup sets up the next encryption keys.
        """
        self.proto.kexAlg = b'diffie-hellman-group14-sha1'
        self.proto.nextEncryptions = MockCipher()
        self.simulateKeyExchange(b'AB', b'CD')
        self.assertEqual(self.proto.sessionID, b'CD')
        self.simulateKeyExchange(b'AB', b'EF')
        self.assertEqual(self.proto.sessionID, b'CD')
        self.assertEqual(self.packets[-1], (transport.MSG_NEWKEYS, b''))
        newKeys = [self.proto._getKey(c, b'AB', b'EF')
                   for c in iterbytes(b'ABCDEF')]
        self.assertEqual(
            self.proto.nextEncryptions.keys,
            (newKeys[1], newKeys[3], newKeys[0], newKeys[2], newKeys[5],
             newKeys[4]))

        Test that _keySetup sets up the next encryption keys.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py