From f4c59767cdfe7716c82a72b00baa427637b505bd Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 22 Oct 2013 20:26:24 -0500 Subject: more backend renames from merged commits --- cryptography/primitives/hashes.py | 2 +- tests/primitives/test_hashes.py | 16 ++++++++-------- 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): -- cgit v1.2.3