diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-06-13 12:59:42 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-06-13 12:59:42 -0700 |
commit | e5645e5ad874adfcb2970fc17b880fbb5ea131aa (patch) | |
tree | 23d4d4d39e0cca3885fd6a8619146954f7d4b52a /tests | |
parent | 772d493aa329f6086e73b43a11505741984cffad (diff) | |
parent | 47f904837f72bb6a5355e139854a17f5875f8928 (diff) |
Merge branch '2.2'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pkey.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_pkey.py b/tests/test_pkey.py index 6e589915..9bb3c44c 100644 --- a/tests/test_pkey.py +++ b/tests/test_pkey.py @@ -455,9 +455,17 @@ class KeyTest(unittest.TestCase): key2 = Ed25519Key.from_private_key_file( test_path('test_ed25519_password.key'), b'abc123' ) - self.assertNotEqual(key1.asbytes(), key2.asbytes()) + def test_ed25519_compare(self): + # verify that the private & public keys compare equal + key = Ed25519Key.from_private_key_file(test_path('test_ed25519.key')) + self.assertEqual(key, key) + pub = Ed25519Key(data=key.asbytes()) + self.assertTrue(key.can_sign()) + self.assertTrue(not pub.can_sign()) + self.assertEqual(key, pub) + def test_keyfile_is_actually_encrypted(self): # Read an existing encrypted private key file_ = test_path('test_rsa_password.key') |