aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-10-25 18:10:15 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-10-25 18:10:15 -0700
commit71725db962e6498d63751db3d8048fa56bcb1252 (patch)
treec5dc00d669395e1b77e7926e350625b8b5c08aee /tests
parentd55fa5b92e92675ef160c26126feb01751d91fb0 (diff)
downloadcryptography-71725db962e6498d63751db3d8048fa56bcb1252.tar.gz
cryptography-71725db962e6498d63751db3d8048fa56bcb1252.tar.bz2
cryptography-71725db962e6498d63751db3d8048fa56bcb1252.zip
make this test happy
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_hashes.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py
index 79fc25c3..bab5bfca 100644
--- a/tests/hazmat/primitives/test_hashes.py
+++ b/tests/hazmat/primitives/test_hashes.py
@@ -23,6 +23,7 @@ from cryptography import utils
from cryptography.exceptions import (
AlreadyFinalized, _Reasons
)
+from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.backends.interfaces import HashBackend
from cryptography.hazmat.primitives import hashes, interfaces
@@ -45,16 +46,11 @@ class TestHashContext(object):
m.update(six.u("\u00FC"))
def test_copy_backend_object(self):
- @utils.register_interface(HashBackend)
- class PretendBackend(object):
- pass
-
- pretend_backend = PretendBackend()
+ backend = default_backend()
copied_ctx = pretend.stub()
pretend_ctx = pretend.stub(copy=lambda: copied_ctx)
- h = hashes.Hash(hashes.SHA1(), backend=pretend_backend,
- ctx=pretend_ctx)
- assert h._backend is pretend_backend
+ h = hashes.Hash(hashes.SHA1(), backend=backend, ctx=pretend_ctx)
+ assert h._backend is backend
assert h.copy()._backend is h._backend
def test_hash_algorithm_instance(self, backend):