def test_getKey(self):
        """
        Test that _getKey generates the correct keys.
        """
        self.proto.kexAlg = self.kexAlgorithm
        self.proto.sessionID = b'EF'

        k1 = self.hashProcessor(
            b'AB' + b'CD' + b'K' + self.proto.sessionID).digest()
        k2 = self.hashProcessor(b'ABCD' + k1).digest()
        k3 = self.hashProcessor(b'ABCD' + k1 + k2).digest()
        k4 = self.hashProcessor(b'ABCD' + k1 + k2 + k3).digest()
        self.assertEqual(
            self.proto._getKey(b'K', b'AB', b'CD'), k1 + k2 + k3 + k4)

        Test that _getKey generates the correct keys.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py