aboutsummaryrefslogtreecommitdiffstats
path: root/tests/x509
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-01-23 22:00:14 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-01-23 21:00:14 -0600
commit5c07d7a87c54a8532b49ba41febe8d526e5734d8 (patch)
treef7b8e6ac665e960d141bc6e836eac47a6bcb1018 /tests/x509
parent908121176f037c618b1f774ab969ad7f67ea3020 (diff)
downloadcryptography-5c07d7a87c54a8532b49ba41febe8d526e5734d8.tar.gz
cryptography-5c07d7a87c54a8532b49ba41febe8d526e5734d8.tar.bz2
cryptography-5c07d7a87c54a8532b49ba41febe8d526e5734d8.zip
Fixes #4734 -- Deal with deprecated things (#4736)
* Fixes #4734 -- Deal with deprecated things - Make year based aliases of PersistentlyDeprecated so we can easily assess age - Removed encode/decode rfc6979 signature - Removed Certificate.serial * Unused import
Diffstat (limited to 'tests/x509')
-rw-r--r--tests/x509/test_x509.py21
-rw-r--r--tests/x509/test_x509_ext.py12
2 files changed, 6 insertions, 27 deletions
diff --git a/tests/x509/test_x509.py b/tests/x509/test_x509.py
index c8c863fb..1ead5947 100644
--- a/tests/x509/test_x509.py
+++ b/tests/x509/test_x509.py
@@ -609,27 +609,6 @@ class TestRSACertificate(object):
SignatureAlgorithmOID._RSA_WITH_SHA1
)
- def test_cert_serial_number(self, backend):
- cert = _load_cert(
- os.path.join("x509", "PKITS_data", "certs", "GoodCACert.crt"),
- x509.load_der_x509_certificate,
- backend
- )
-
- with pytest.warns(utils.CryptographyDeprecationWarning):
- assert cert.serial == 2
- assert cert.serial_number == 2
-
- def test_cert_serial_warning(self, backend):
- cert = _load_cert(
- os.path.join("x509", "PKITS_data", "certs", "GoodCACert.crt"),
- x509.load_der_x509_certificate,
- backend
- )
-
- with pytest.warns(utils.CryptographyDeprecationWarning):
- cert.serial
-
def test_load_der_cert(self, backend):
cert = _load_cert(
os.path.join("x509", "PKITS_data", "certs", "GoodCACert.crt"),
diff --git a/tests/x509/test_x509_ext.py b/tests/x509/test_x509_ext.py
index 6de105fa..6cf388da 100644
--- a/tests/x509/test_x509_ext.py
+++ b/tests/x509/test_x509_ext.py
@@ -1673,11 +1673,11 @@ class TestKeyUsageExtension(object):
class TestDNSName(object):
def test_init_deprecated(self):
pytest.importorskip("idna")
- with pytest.warns(utils.DeprecatedIn21):
+ with pytest.warns(utils.CryptographyDeprecationWarning):
name = x509.DNSName(u".\xf5\xe4\xf6\xfc.example.com")
assert name.value == u".xn--4ca7aey.example.com"
- with pytest.warns(utils.DeprecatedIn21):
+ with pytest.warns(utils.CryptographyDeprecationWarning):
name = x509.DNSName(u"\xf5\xe4\xf6\xfc.example.com")
assert name.value == u"xn--4ca7aey.example.com"
@@ -1792,7 +1792,7 @@ class TestRFC822Name(object):
def test_idna(self):
pytest.importorskip("idna")
- with pytest.warns(utils.DeprecatedIn21):
+ with pytest.warns(utils.CryptographyDeprecationWarning):
gn = x509.RFC822Name(u"email@em\xe5\xefl.com")
assert gn.value == u"email@xn--eml-vla4c.com"
@@ -1832,7 +1832,7 @@ class TestUniformResourceIdentifier(object):
def test_idna_no_port(self):
pytest.importorskip("idna")
- with pytest.warns(utils.DeprecatedIn21):
+ with pytest.warns(utils.CryptographyDeprecationWarning):
gn = x509.UniformResourceIdentifier(
u"http://\u043f\u044b\u043a\u0430.cryptography"
)
@@ -1841,7 +1841,7 @@ class TestUniformResourceIdentifier(object):
def test_idna_with_port(self):
pytest.importorskip("idna")
- with pytest.warns(utils.DeprecatedIn21):
+ with pytest.warns(utils.CryptographyDeprecationWarning):
gn = x509.UniformResourceIdentifier(
u"gopher://\u043f\u044b\u043a\u0430.cryptography:70/some/path"
)
@@ -1856,7 +1856,7 @@ class TestUniformResourceIdentifier(object):
def test_query_and_fragment(self):
pytest.importorskip("idna")
- with pytest.warns(utils.DeprecatedIn21):
+ with pytest.warns(utils.CryptographyDeprecationWarning):
gn = x509.UniformResourceIdentifier(
u"ldap://\u043f\u044b\u043a\u0430.cryptography:90/path?query="
u"true#somedata"