aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_serialization.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-23 20:45:21 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-25 07:50:25 -0600
commit199dc276cd1b45a799b511090b37237df49d68a3 (patch)
tree448ed0a7f78542c967e4515c3f3f817104cc40a0 /tests/hazmat/primitives/test_serialization.py
parentf83e25c81bb186ed8a96d4a569d5068546a24349 (diff)
downloadcryptography-199dc276cd1b45a799b511090b37237df49d68a3.tar.gz
cryptography-199dc276cd1b45a799b511090b37237df49d68a3.tar.bz2
cryptography-199dc276cd1b45a799b511090b37237df49d68a3.zip
address review comments
Diffstat (limited to 'tests/hazmat/primitives/test_serialization.py')
-rw-r--r--tests/hazmat/primitives/test_serialization.py23
1 files changed, 4 insertions, 19 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py
index 2a5fb21d..fc8f8664 100644
--- a/tests/hazmat/primitives/test_serialization.py
+++ b/tests/hazmat/primitives/test_serialization.py
@@ -18,9 +18,8 @@ from cryptography.hazmat.backends.interfaces import (
)
from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
from cryptography.hazmat.primitives.serialization import (
- BestAvailable, Encoding, PKCS8, TraditionalOpenSSL, load_der_private_key,
- load_der_public_key, load_pem_private_key, load_pem_public_key,
- load_ssh_public_key
+ BestAvailableEncryption, load_der_private_key, load_der_public_key,
+ load_pem_private_key, load_pem_public_key, load_ssh_public_key
)
@@ -1162,25 +1161,11 @@ class TestECDSASSHSerialization(object):
load_ssh_public_key(ssh_key, backend)
-@pytest.mark.parametrize(
- "serializer",
- [PKCS8, TraditionalOpenSSL]
-)
-class TestSerializers(object):
- def test_invalid_encoding(self, serializer):
- with pytest.raises(TypeError):
- serializer("thing")
-
- def test_valid_params(self, serializer):
- fmt = serializer(Encoding.PEM)
- assert isinstance(fmt, (PKCS8, TraditionalOpenSSL))
-
-
class TestKeySerializationEncryptionTypes(object):
def test_non_bytes_password(self):
with pytest.raises(ValueError):
- BestAvailable(object())
+ BestAvailableEncryption(object())
def test_encryption_with_zero_length_password(self):
with pytest.raises(ValueError):
- BestAvailable(b"")
+ BestAvailableEncryption(b"")