'L{changePassPhrase} exits if the file specified points to an invalid
key.'

def test_changePassphraseBadKey(self):

    filename = self.mktemp()
    FilePath(filename).setContent('foobar')
    error = self.assertRaises(SystemExit, changePassPhrase, {'filename': filename})
    if _PY3:
        expected = "Could    not    change    passphrase:    cannot    guess    the    type    of    b'foobar'"
    else:
        expected = "Could    not    change    passphrase:    cannot    guess    the    type    of    'foobar'"
    self.assertEqual(expected, str(error))
    self.assertEqual('foobar', FilePath(filename).getContent())
