'L{keys._getPersistentRSAKey} will not regenerate the key if the key
already exists.'

def test_noRegeneration(self):

    tempDir = FilePath(self.mktemp())
    keyFile = tempDir.child('mykey.pem')
    key = keys._getPersistentRSAKey(keyFile, keySize=512)
    self.assertEqual(key.size(), 512)
    self.assertTrue(keyFile.exists())
    keyContent = keyFile.getContent()
    key = keys._getPersistentRSAKey(keyFile, keySize=1024)
    self.assertEqual(key.size(), 512)
    self.assertEqual(keyFile.getContent(), keyContent)
