diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-09-22 12:54:51 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-09-22 12:54:51 -0700 |
commit | 519d5a034de887982136fcfdb6dffef47e46dd88 (patch) | |
tree | 2e6c0265b86d35d26b323923c176eed1ca621b67 /tests/test_pkey.py | |
parent | f511eaf487d59fe60271b2e4aac5fe0470fecf92 (diff) |
Move cert tests & copies of related keys into separate folder.
This prevents non-cert-related tests from incidentally loading
the certs, which was masking issues (re #1071)
Diffstat (limited to 'tests/test_pkey.py')
-rw-r--r-- | tests/test_pkey.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_pkey.py b/tests/test_pkey.py index 099fa4b0..95557621 100644 --- a/tests/test_pkey.py +++ b/tests/test_pkey.py @@ -489,9 +489,13 @@ class KeyTest(unittest.TestCase): def test_certificates(self): # PKey.load_certificate - key = RSAKey.from_private_key_file(test_path('test_rsa.key')) + key_path = test_path(os.path.join('cert_support', 'test_rsa.key')) + key = RSAKey.from_private_key_file(key_path) self.assertTrue(key.public_blob is None) - key.load_certificate(test_path('test_rsa.key-cert.pub')) + cert_path = test_path( + os.path.join('cert_support', 'test_rsa.key-cert.pub') + ) + key.load_certificate(cert_path) self.assertTrue(key.public_blob is not None) self.assertEqual(key.public_blob.key_type, 'ssh-rsa-cert-v01@openssh.com') self.assertEqual(key.public_blob.comment, 'test_rsa.key.pub') @@ -507,7 +511,8 @@ class KeyTest(unittest.TestCase): self.assertEqual(msg.get_int64(), 1234) # Prevented from loading certificate that doesn't match - key1 = Ed25519Key.from_private_key_file(test_path('test_ed25519.key')) + key_path = test_path(os.path.join('cert_support', 'test_ed25519.key')) + key1 = Ed25519Key.from_private_key_file(key_path) self.assertRaises( ValueError, key1.load_certificate, |