def test_changePassphraseEmptyStringError(self):
        """
        L{changePassPhrase} doesn't modify the key file if C{toString} returns
        an empty string.
        """
        filename = self.mktemp()
        FilePath(filename).setContent(privateRSA_openssh)

        def toString(*args, **kwargs):
            return ''

        self.patch(Key, 'toString', toString)

        error = self.assertRaises(
            SystemExit, changePassPhrase,
            {'filename': filename, 'newpass': 'newencrypt'})

        if _PY3:
            expected = (
                "Could not change passphrase: cannot guess the type of b''")
        else:
            expected = (
                "Could not change passphrase: cannot guess the type of ''")
        self.assertEqual(expected, str(error))

        self.assertEqual(privateRSA_openssh, FilePath(filename).getContent())

        L{changePassPhrase} doesn't modify the key file if C{toString} returns
        an empty string.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_ckeygen.py