diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-20 13:15:28 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-22 16:48:42 -0500 |
commit | daac6d056753614077941da0a392c086dadbe965 (patch) | |
tree | 6f8e9e3c5912d7d2c48625286e87a23d38bd82b4 /tests | |
parent | f2259868052becbf38c05f0dfabee41fbaabf72e (diff) | |
download | cryptography-daac6d056753614077941da0a392c086dadbe965.tar.gz cryptography-daac6d056753614077941da0a392c086dadbe965.tar.bz2 cryptography-daac6d056753614077941da0a392c086dadbe965.zip |
When copying a hash, pass the api through to the new object
Diffstat (limited to 'tests')
-rw-r--r-- | tests/primitives/test_hashes.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/primitives/test_hashes.py b/tests/primitives/test_hashes.py index 03de8916..d721f7af 100644 --- a/tests/primitives/test_hashes.py +++ b/tests/primitives/test_hashes.py @@ -17,6 +17,8 @@ import pytest import six +from cryptography.bindings import _default_api + from cryptography.primitives import hashes from .utils import generate_base_hash_test @@ -33,6 +35,15 @@ class TestBaseHash(object): assert isinstance(m.hexdigest(), str) +class TestDefaultAPISHA1(object): + def test_default_api_creation(self): + """ + This test assumes the presence of SHA1 in the default API. + """ + h = hashes.SHA1() + assert h._api == _default_api + + class TestSHA1(object): test_SHA1 = generate_base_hash_test( hashes.SHA1, |