diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hazmat/primitives/test_ec.py | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 1f3a67d3..cd30223c 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -11,7 +11,7 @@ from binascii import hexlify  import pytest -from cryptography import exceptions, utils +from cryptography import exceptions, utils, x509  from cryptography.hazmat.backends.interfaces import (      EllipticCurveBackend, PEMSerializationBackend  ) @@ -71,6 +71,12 @@ def _skip_exchange_algorithm_unsupported(backend, algorithm, curve):          ) +def test_get_curve_for_oid(): +    assert ec.get_curve_for_oid(ec.EllipticCurveOID.SECP256R1) == ec.SECP256R1 +    with pytest.raises(LookupError): +        ec.get_curve_for_oid(x509.ObjectIdentifier("1.1.1.1")) + +  @utils.register_interface(ec.EllipticCurve)  class DummyCurve(object):      name = "dummy-curve"  | 
