aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_serialization.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-12-23 15:54:40 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-12-23 15:54:40 -0600
commit1a33984faa8462eebd572820fe84f2196b57748b (patch)
tree7e5bc0ac7415ba2f93469215dcb4a5350b37997e /tests/hazmat/primitives/test_serialization.py
parent35d2931e32bca6d4ed20a15d108fedfab4ed6afa (diff)
downloadcryptography-1a33984faa8462eebd572820fe84f2196b57748b.tar.gz
cryptography-1a33984faa8462eebd572820fe84f2196b57748b.tar.bz2
cryptography-1a33984faa8462eebd572820fe84f2196b57748b.zip
add both types of EC key formats to parametrized test
Diffstat (limited to 'tests/hazmat/primitives/test_serialization.py')
-rw-r--r--tests/hazmat/primitives/test_serialization.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py
index b2067ca5..f3166d7b 100644
--- a/tests/hazmat/primitives/test_serialization.py
+++ b/tests/hazmat/primitives/test_serialization.py
@@ -95,18 +95,19 @@ class TestPEMSerialization(object):
_check_dsa_private_numbers(key.private_numbers())
@pytest.mark.parametrize(
- ("key_file", "password"),
+ ("key_path", "password"),
[
- ("ec_private_key.pem", None),
- ("ec_private_key_encrypted.pem", b"123456"),
+ (["PKCS8", "ec_private_key.pem"], None),
+ (["PKCS8", "ec_private_key_encrypted.pem"], b"123456"),
+ (["PEM_Serialization", "ec_private_key.pem"], None),
+ (["PEM_Serialization", "ec_private_key_encrypted.pem"], b"123456"),
]
)
@pytest.mark.requires_backend_interface(interface=EllipticCurveBackend)
- def test_load_pem_ec_private_key(self, key_file, password, backend):
+ def test_load_pem_ec_private_key(self, key_path, password, backend):
_skip_curve_unsupported(backend, ec.SECP256R1())
key = load_vectors_from_file(
- os.path.join(
- "asymmetric", "PEM_Serialization", key_file),
+ os.path.join("asymmetric", *key_path),
lambda pemfile: load_pem_private_key(
pemfile.read().encode(), password, backend
)