aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormichael-hart <michael.hart1994@gmail.com>2014-09-23 23:10:32 +0100
committermichael-hart <michael.hart1994@gmail.com>2014-09-26 18:40:27 +0100
commit2ca899115b80dba47b65a8255bbbce1cce2ce238 (patch)
treead628532f0bcefc258a88ce3c383dddce53a9e37 /tests
parentfe2cd085cffe05fbdec02164a93de7812acb44dd (diff)
downloadcryptography-2ca899115b80dba47b65a8255bbbce1cce2ce238.tar.gz
cryptography-2ca899115b80dba47b65a8255bbbce1cce2ce238.tar.bz2
cryptography-2ca899115b80dba47b65a8255bbbce1cce2ce238.zip
Part 1 of rebase, with corrections for pep8
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_serialization.py28
1 files changed, 5 insertions, 23 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py
index 7cbd3f71..4bc7e811 100644
--- a/tests/hazmat/primitives/test_serialization.py
+++ b/tests/hazmat/primitives/test_serialization.py
@@ -82,39 +82,21 @@ class TestPEMSerialization(object):
assert key
assert isinstance(key, interfaces.EllipticCurvePrivateKey)
- @pytest.mark.parametrize(
- ("key_file"),
- [
- os.path.join("asymmetric", "PKCS8", "unenc-rsa-pkcs8.pub.pem"),
+ def test_load_pem_rsa_public_key(self, backend):
+ key = load_vectors_from_file(
os.path.join(
"asymmetric", "PEM_Serialization", "rsa_public_key.pem"),
- ]
- )
- def test_load_pem_rsa_public_key(self, key_file, backend):
- key = load_vectors_from_file(
- key_file,
lambda pemfile: load_pem_public_key(
pemfile.read().encode(), backend
)
)
assert key
assert isinstance(key, interfaces.RSAPublicKey)
- if isinstance(key, interfaces.RSAPublicKeyWithNumbers):
- numbers = key.public_numbers()
- assert numbers.e == 65537
- @pytest.mark.parametrize(
- ("key_file"),
- [
- os.path.join("asymmetric", "PKCS8", "unenc-dsa-pkcs8.pub.pem"),
- os.path.join(
- "asymmetric", "PEM_Serialization",
- "dsa_public_key.pem"),
- ]
- )
- def test_load_pem_dsa_public_key(self, key_file, backend):
+ def test_load_pem_dsa_public_key(self, backend):
key = load_vectors_from_file(
- key_file,
+ os.path.join(
+ "asymmetric", "PEM_Serialization", "dsa_public_key.pem"),
lambda pemfile: load_pem_public_key(
pemfile.read().encode(), backend
)