aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r--tests/hazmat/primitives/test_aes.py2
-rw-r--r--tests/hazmat/primitives/test_block.py2
-rw-r--r--tests/hazmat/primitives/test_ciphers.py2
-rw-r--r--tests/hazmat/primitives/test_hkdf.py3
-rw-r--r--tests/hazmat/primitives/test_hmac.py2
-rw-r--r--tests/hazmat/primitives/test_pbkdf2hmac.py4
-rw-r--r--tests/hazmat/primitives/test_rsa.py4
-rw-r--r--tests/hazmat/primitives/twofactor/test_hotp.py4
-rw-r--r--tests/hazmat/primitives/twofactor/test_totp.py2
-rw-r--r--tests/hazmat/primitives/utils.py14
10 files changed, 18 insertions, 21 deletions
diff --git a/tests/hazmat/primitives/test_aes.py b/tests/hazmat/primitives/test_aes.py
index ad3626af..03be268d 100644
--- a/tests/hazmat/primitives/test_aes.py
+++ b/tests/hazmat/primitives/test_aes.py
@@ -20,7 +20,7 @@ import pytest
from cryptography.hazmat.primitives.ciphers import algorithms, modes
-from .utils import generate_encrypt_test, generate_aead_test
+from .utils import generate_aead_test, generate_encrypt_test
from ...utils import load_nist_vectors
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index 8ff00fd9..f2dab6cf 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -18,7 +18,7 @@ import binascii
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedCipher, AlreadyFinalized
+from cryptography.exceptions import AlreadyFinalized, UnsupportedCipher
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers import (
Cipher, algorithms, modes
diff --git a/tests/hazmat/primitives/test_ciphers.py b/tests/hazmat/primitives/test_ciphers.py
index bd9625e9..1bea0bdb 100644
--- a/tests/hazmat/primitives/test_ciphers.py
+++ b/tests/hazmat/primitives/test_ciphers.py
@@ -20,7 +20,7 @@ import pytest
from cryptography.exceptions import UnsupportedInterface
from cryptography.hazmat.primitives import ciphers
from cryptography.hazmat.primitives.ciphers.algorithms import (
- AES, Camellia, TripleDES, Blowfish, ARC4, CAST5, IDEA
+ AES, ARC4, Blowfish, CAST5, Camellia, IDEA, TripleDES
)
from cryptography.hazmat.primitives.ciphers.modes import ECB
diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py
index 963fb69c..989709c6 100644
--- a/tests/hazmat/primitives/test_hkdf.py
+++ b/tests/hazmat/primitives/test_hkdf.py
@@ -13,9 +13,8 @@
from __future__ import absolute_import, division, print_function
-import six
-
import pytest
+import six
from cryptography.exceptions import (
AlreadyFinalized, InvalidKey, UnsupportedInterface
diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py
index 3589e6ac..1065359a 100644
--- a/tests/hazmat/primitives/test_hmac.py
+++ b/tests/hazmat/primitives/test_hmac.py
@@ -21,7 +21,7 @@ import six
from cryptography import utils
from cryptography.exceptions import (
- AlreadyFinalized, UnsupportedHash, InvalidSignature, UnsupportedInterface
+ AlreadyFinalized, InvalidSignature, UnsupportedHash, UnsupportedInterface
)
from cryptography.hazmat.backends.interfaces import HMACBackend
from cryptography.hazmat.primitives import hashes, hmac, interfaces
diff --git a/tests/hazmat/primitives/test_pbkdf2hmac.py b/tests/hazmat/primitives/test_pbkdf2hmac.py
index bf1e7f14..585693ea 100644
--- a/tests/hazmat/primitives/test_pbkdf2hmac.py
+++ b/tests/hazmat/primitives/test_pbkdf2hmac.py
@@ -18,11 +18,11 @@ import six
from cryptography import utils
from cryptography.exceptions import (
- InvalidKey, UnsupportedHash, AlreadyFinalized, UnsupportedInterface
+ AlreadyFinalized, InvalidKey, UnsupportedHash, UnsupportedInterface
)
+from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, interfaces
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
-from cryptography.hazmat.backends import default_backend
@utils.register_interface(interfaces.HashAlgorithm)
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index 955e69c9..67b5b2e0 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -25,11 +25,11 @@ from cryptography.exceptions import (
UnsupportedAlgorithm, UnsupportedInterface
)
from cryptography.hazmat.primitives import hashes, interfaces
-from cryptography.hazmat.primitives.asymmetric import rsa, padding
+from cryptography.hazmat.primitives.asymmetric import padding, rsa
from .utils import generate_rsa_pss_test
from ...utils import (
- load_pkcs1_vectors, load_vectors_from_file, load_rsa_nist_vectors
+ load_pkcs1_vectors, load_rsa_nist_vectors, load_vectors_from_file
)
diff --git a/tests/hazmat/primitives/twofactor/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py
index 548c6264..7692a082 100644
--- a/tests/hazmat/primitives/twofactor/test_hotp.py
+++ b/tests/hazmat/primitives/twofactor/test_hotp.py
@@ -18,10 +18,10 @@ import os
import pytest
from cryptography.exceptions import InvalidToken, UnsupportedInterface
-from cryptography.hazmat.primitives.twofactor.hotp import HOTP
from cryptography.hazmat.primitives import hashes
-from tests.utils import load_vectors_from_file, load_nist_vectors
from cryptography.hazmat.primitives.hashes import MD5, SHA1
+from cryptography.hazmat.primitives.twofactor.hotp import HOTP
+from tests.utils import load_nist_vectors, load_vectors_from_file
vectors = load_vectors_from_file(
"twofactor/rfc-4226.txt", load_nist_vectors)
diff --git a/tests/hazmat/primitives/twofactor/test_totp.py b/tests/hazmat/primitives/twofactor/test_totp.py
index 294c19ab..0b10c969 100644
--- a/tests/hazmat/primitives/twofactor/test_totp.py
+++ b/tests/hazmat/primitives/twofactor/test_totp.py
@@ -18,7 +18,7 @@ import pytest
from cryptography.exceptions import InvalidToken, UnsupportedInterface
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.twofactor.totp import TOTP
-from tests.utils import load_vectors_from_file, load_nist_vectors
+from tests.utils import load_nist_vectors, load_vectors_from_file
vectors = load_vectors_from_file(
"twofactor/rfc-6238.txt", load_nist_vectors)
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index 31491023..a29ef70e 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -14,21 +14,19 @@
from __future__ import absolute_import, division, print_function
import binascii
-import os
-
import itertools
+import os
import pytest
+from cryptography.exceptions import (
+ AlreadyFinalized, AlreadyUpdated, InvalidTag, NotYetFinalized
+)
from cryptography.hazmat.primitives import hashes, hmac
-from cryptography.hazmat.primitives.asymmetric import rsa, padding
-from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
+from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
-
-from cryptography.exceptions import (
- AlreadyFinalized, NotYetFinalized, AlreadyUpdated, InvalidTag,
-)
+from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from ...utils import load_vectors_from_file