diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-11-11 20:43:52 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-11-11 20:43:52 -0600 |
commit | f7f6a9f77ade1b190766c37cc8967375b5093175 (patch) | |
tree | ccaf9bcf7033a58c9e55f2996b328f108da66c1b /tests/hazmat/primitives/utils.py | |
parent | 92beb221fc0a1bd8ef1b955a98e1385daed0f207 (diff) | |
download | cryptography-f7f6a9f77ade1b190766c37cc8967375b5093175.tar.gz cryptography-f7f6a9f77ade1b190766c37cc8967375b5093175.tar.bz2 cryptography-f7f6a9f77ade1b190766c37cc8967375b5093175.zip |
Remove separate file loaders and replace with one
All tests updated to work with the new simplified loader
Diffstat (limited to 'tests/hazmat/primitives/utils.py')
-rw-r--r-- | tests/hazmat/primitives/utils.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index 90c15b13..0f975950 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -8,6 +8,8 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives import hmac from cryptography.hazmat.primitives.ciphers import Cipher +from ...utils import load_vectors_from_file + def generate_encrypt_test(param_loader, path, file_names, cipher_factory, mode_factory, only_if=lambda backend: True, @@ -15,7 +17,10 @@ def generate_encrypt_test(param_loader, path, file_names, cipher_factory, def test_encryption(self): for backend in _ALL_BACKENDS: for file_name in file_names: - for params in param_loader(os.path.join(path, file_name)): + for params in load_vectors_from_file( + os.path.join(path, file_name), + param_loader + ): yield ( encrypt_test, backend, @@ -55,7 +60,10 @@ def generate_stream_encryption_test(param_loader, path, file_names, def test_stream_encryption(self): for backend in _ALL_BACKENDS: for file_name in file_names: - for params in param_loader(os.path.join(path, file_name)): + for params in load_vectors_from_file( + os.path.join(path, file_name), + param_loader + ): yield ( stream_encryption_test, backend, @@ -93,7 +101,10 @@ def generate_hash_test(param_loader, path, file_names, hash_cls, def test_hash(self): for backend in _ALL_BACKENDS: for file_name in file_names: - for params in param_loader(os.path.join(path, file_name)): + for params in load_vectors_from_file( + os.path.join(path, file_name), + param_loader + ): yield ( hash_test, backend, @@ -173,7 +184,10 @@ def generate_hmac_test(param_loader, path, file_names, algorithm, def test_hmac(self): for backend in _ALL_BACKENDS: for file_name in file_names: - for params in param_loader(os.path.join(path, file_name)): + for params in load_vectors_from_file( + os.path.join(path, file_name), + param_loader + ): yield ( hmac_test, backend, |