':py:meth:`PKeyType.generate_key` can be called multiple times on the same
key to generate new keys.'

def test_regeneration(self):

    key = PKey()
    for (type, bits) in [(TYPE_RSA, 512), (TYPE_DSA, 576)]:
        key.generate_key(type, bits)
        self.assertEqual(key.type(), type)
        self.assertEqual(key.bits(), bits)
