'L{changePassPhrase} doesn\'t modify the key file if an unexpected error
happens when trying to create the key with the new passphrase.'

def test_changePassphraseCreateError(self):

    filename = self.mktemp()
    FilePath(filename).setContent(privateRSA_openssh)
    def toString(*args, **kwargs):
        raise RuntimeError('oops')
    self.patch(Key, 'toString', toString)
    error = self.assertRaises(SystemExit, changePassPhrase, {'filename': filename, 'newpass': 'newencrypt'})
    self.assertEqual('Could    not    change    passphrase:    oops', str(error))
    self.assertEqual(privateRSA_openssh, FilePath(filename).getContent())
