From 2ca899115b80dba47b65a8255bbbce1cce2ce238 Mon Sep 17 00:00:00 2001 From: michael-hart Date: Tue, 23 Sep 2014 23:10:32 +0100 Subject: Part 1 of rebase, with corrections for pep8 --- tests/hazmat/primitives/test_serialization.py | 28 +++++---------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'tests/hazmat/primitives') 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 ) -- cgit v1.2.3