From fcadda6a89095fc92e6fe2e248e93b642ce8580b Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 10 Mar 2015 10:01:18 -0400 Subject: Fixed the deprecation warnings being triggered by the tests --- tests/hazmat/primitives/test_dsa.py | 4 ++-- tests/hazmat/primitives/test_ec.py | 2 +- tests/hazmat/primitives/test_rsa.py | 2 +- tests/hazmat/primitives/test_serialization.py | 12 ++++++------ tests/test_x509.py | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py index 112818f4..bbafbc6c 100644 --- a/tests/hazmat/primitives/test_dsa.py +++ b/tests/hazmat/primitives/test_dsa.py @@ -75,7 +75,7 @@ class TestDSA(object): g=vector['g'] ).parameters(backend) skey = parameters.generate_private_key() - if isinstance(skey, dsa.DSAPrivateKeyWithNumbers): + if isinstance(skey, dsa.DSAPrivateKeyWithSerialization): numbers = skey.private_numbers() skey_parameters = numbers.public_numbers.parameter_numbers pkey = skey.public_key() @@ -98,7 +98,7 @@ class TestDSA(object): def test_generate_dsa_private_key_and_parameters(self, backend): skey = dsa.generate_private_key(1024, backend) assert skey - if isinstance(skey, dsa.DSAPrivateKeyWithNumbers): + if isinstance(skey, dsa.DSAPrivateKeyWithSerialization): numbers = skey.private_numbers() skey_parameters = numbers.public_numbers.parameter_numbers assert numbers.public_numbers.y == pow( diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 40b1741c..23f9aff9 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -173,7 +173,7 @@ class TestECWithNumbers(object): ).private_key(backend) assert key - if isinstance(key, ec.EllipticCurvePrivateKeyWithNumbers): + if isinstance(key, ec.EllipticCurvePrivateKeyWithSerialization): priv_num = key.private_numbers() assert priv_num.private_value == vector['d'] assert priv_num.public_numbers.x == vector['x'] diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index e6d0ac28..d79d9320 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -113,7 +113,7 @@ class TestRSA(object): skey = rsa.generate_private_key(public_exponent, key_size, backend) assert skey.key_size == key_size - if isinstance(skey, rsa.RSAPrivateKeyWithNumbers): + if isinstance(skey, rsa.RSAPrivateKeyWithSerialization): _check_rsa_private_numbers(skey.private_numbers()) pkey = skey.public_key() assert isinstance(pkey.public_numbers(), rsa.RSAPublicNumbers) diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index 07a8f02e..22c2145c 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -53,7 +53,7 @@ class TestDERSerialization(object): ) assert key assert isinstance(key, rsa.RSAPrivateKey) - if isinstance(key, rsa.RSAPrivateKeyWithNumbers): + if isinstance(key, rsa.RSAPrivateKeyWithSerialization): _check_rsa_private_numbers(key.private_numbers()) @pytest.mark.requires_backend_interface(interface=DSABackend) @@ -76,7 +76,7 @@ class TestDERSerialization(object): ) assert key assert isinstance(key, dsa.DSAPrivateKey) - if isinstance(key, dsa.DSAPrivateKeyWithNumbers): + if isinstance(key, dsa.DSAPrivateKeyWithSerialization): _check_dsa_private_numbers(key.private_numbers()) @pytest.mark.parametrize( @@ -247,7 +247,7 @@ class TestDERSerialization(object): ) assert key assert isinstance(key, rsa.RSAPublicKey) - if isinstance(key, rsa.RSAPublicKeyWithNumbers): + if isinstance(key, rsa.RSAPublicKeyWithSerialization): numbers = key.public_numbers() assert numbers.e == 65537 @@ -330,7 +330,7 @@ class TestPEMSerialization(object): assert key assert isinstance(key, rsa.RSAPrivateKey) - if isinstance(key, rsa.RSAPrivateKeyWithNumbers): + if isinstance(key, rsa.RSAPrivateKeyWithSerialization): _check_rsa_private_numbers(key.private_numbers()) @pytest.mark.parametrize( @@ -352,7 +352,7 @@ class TestPEMSerialization(object): ) assert key assert isinstance(key, dsa.DSAPrivateKey) - if isinstance(key, dsa.DSAPrivateKeyWithNumbers): + if isinstance(key, dsa.DSAPrivateKeyWithSerialization): _check_dsa_private_numbers(key.private_numbers()) @pytest.mark.parametrize( @@ -397,7 +397,7 @@ class TestPEMSerialization(object): ) assert key assert isinstance(key, rsa.RSAPublicKey) - if isinstance(key, rsa.RSAPublicKeyWithNumbers): + if isinstance(key, rsa.RSAPublicKeyWithSerialization): numbers = key.public_numbers() assert numbers.e == 65537 diff --git a/tests/test_x509.py b/tests/test_x509.py index 04408321..2a472686 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -353,7 +353,7 @@ class TestDSACertificate(object): assert isinstance(cert.signature_hash_algorithm, hashes.SHA1) public_key = cert.public_key() assert isinstance(public_key, dsa.DSAPublicKey) - if isinstance(public_key, dsa.DSAPublicKeyWithNumbers): + if isinstance(public_key, dsa.DSAPublicKeyWithSerialization): num = public_key.public_numbers() assert num.y == int( "4c08bfe5f2d76649c80acf7d431f6ae2124b217abc8c9f6aca776ddfa94" @@ -406,7 +406,7 @@ class TestECDSACertificate(object): assert isinstance(cert.signature_hash_algorithm, hashes.SHA384) public_key = cert.public_key() assert isinstance(public_key, ec.EllipticCurvePublicKey) - if isinstance(public_key, ec.EllipticCurvePublicKeyWithNumbers): + if isinstance(public_key, ec.EllipticCurvePublicKeyWithSerialization): num = public_key.public_numbers() assert num.x == int( "dda7d9bb8ab80bfb0b7f21d2f0bebe73f3335d1abc34eadec69bbcd095f" -- cgit v1.2.3