aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-10-22 20:26:24 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-10-22 20:26:24 -0500
commitf4c59767cdfe7716c82a72b00baa427637b505bd (patch)
treefebc087d21873d764c7701a18f79cf4eef649f9c
parent360e2d53190fa612eccd3ae43c7cd3c240282a7a (diff)
downloadcryptography-f4c59767cdfe7716c82a72b00baa427637b505bd.tar.gz
cryptography-f4c59767cdfe7716c82a72b00baa427637b505bd.tar.bz2
cryptography-f4c59767cdfe7716c82a72b00baa427637b505bd.zip
more backend renames from merged commits
-rw-r--r--cryptography/primitives/hashes.py2
-rw-r--r--tests/primitives/test_hashes.py16
2 files changed, 9 insertions, 9 deletions
diff --git a/cryptography/primitives/hashes.py b/cryptography/primitives/hashes.py
index 474dc167..4cd68adc 100644
--- a/cryptography/primitives/hashes.py
+++ b/cryptography/primitives/hashes.py
@@ -40,7 +40,7 @@ class BaseHash(six.with_metaclass(abc.ABCMeta)):
self._backend.update_hash_context(self._ctx, data)
def copy(self):
- return self.__class__(api=self._api, ctx=self._copy_ctx())
+ return self.__class__(backend=self._backend, ctx=self._copy_ctx())
def digest(self):
return self._backend.finalize_hash_context(self._copy_ctx(),
diff --git a/tests/primitives/test_hashes.py b/tests/primitives/test_hashes.py
index 7ddd1859..2efda050 100644
--- a/tests/primitives/test_hashes.py
+++ b/tests/primitives/test_hashes.py
@@ -19,7 +19,7 @@ import pytest
import six
-from cryptography.bindings import _default_api
+from cryptography.bindings import _default_backend
from cryptography.primitives import hashes
@@ -38,21 +38,21 @@ class TestBaseHash(object):
class TestCopyHash(object):
- def test_copy_api_object(self):
- pretend_api = pretend.stub(copy_hash_context=lambda a: "copiedctx")
+ def test_copy_backend_object(self):
+ pretend_backend = pretend.stub(copy_hash_context=lambda a: "copiedctx")
pretend_ctx = pretend.stub()
- h = hashes.SHA1(api=pretend_api, ctx=pretend_ctx)
- assert h._api is pretend_api
- assert h.copy()._api is h._api
+ h = hashes.SHA1(backend=pretend_backend, ctx=pretend_ctx)
+ assert h._backend is pretend_backend
+ assert h.copy()._backend is h._backend
class TestDefaultAPISHA1(object):
- def test_default_api_creation(self):
+ def test_default_backend_creation(self):
"""
This test assumes the presence of SHA1 in the default API.
"""
h = hashes.SHA1()
- assert h._api is _default_api
+ assert h._backend is _default_backend
class TestSHA1(object):