When copying a hash, pass the api through to the new object
diff --git a/tests/primitives/test_hashes.py b/tests/primitives/test_hashes.py
index 03de891..d721f7a 100644
--- a/tests/primitives/test_hashes.py
+++ b/tests/primitives/test_hashes.py
@@ -17,6 +17,8 @@
import six
+from cryptography.bindings import _default_api
+
from cryptography.primitives import hashes
from .utils import generate_base_hash_test
@@ -33,6 +35,15 @@
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,