From 9668b000326585339267a42176facd9ff81481ee Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 3 Nov 2019 01:47:13 -0400 Subject: Deal with the 2.5 deprecations (#5048) * Deal with the 2.5 deprecations * pep8 + test fixes * docs typo * Why did I do this? * typo --- tests/hazmat/primitives/test_ec.py | 2 +- tests/hazmat/primitives/test_x25519.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 922a25f0..987c0ff0 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -181,7 +181,7 @@ def test_encode_point(): 16 ) pn = ec.EllipticCurvePublicNumbers(x, y, ec.SECP256R1()) - with pytest.warns(utils.DeprecatedIn25): + with pytest.warns(utils.PersistentlyDeprecated2019): data = pn.encode_point() assert data == binascii.unhexlify( "04233ea3b0027127084cd2cd336a13aeef69c598d8af61369a36454a17c6c22ae" diff --git a/tests/hazmat/primitives/test_x25519.py b/tests/hazmat/primitives/test_x25519.py index 8bdc6b49..30dc2818 100644 --- a/tests/hazmat/primitives/test_x25519.py +++ b/tests/hazmat/primitives/test_x25519.py @@ -9,7 +9,6 @@ import os import pytest -from cryptography import utils from cryptography.exceptions import _Reasons from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric.x25519 import ( @@ -95,16 +94,11 @@ class TestX25519Exchange(object): with pytest.raises(ValueError): private_key.exchange(public_key) - def test_deprecated_public_bytes(self, backend): - key = X25519PrivateKey.generate().public_key() - with pytest.warns(utils.DeprecatedIn25): - key.public_bytes() - def test_public_bytes_bad_args(self, backend): key = X25519PrivateKey.generate().public_key() with pytest.raises(ValueError): key.public_bytes(None, serialization.PublicFormat.Raw) - with pytest.raises(ValueError): + with pytest.raises(TypeError): key.public_bytes(serialization.Encoding.Raw) # These vectors are also from RFC 7748 -- cgit v1.2.3