From 077e76e697ebf25aa9fd757f0ef1fd1251b7d408 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 5 Nov 2013 12:59:37 -0800 Subject: Explicit backend --- tests/hazmat/primitives/test_hmac.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests/hazmat/primitives/test_hmac.py') diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py index d17049e3..622f186a 100644 --- a/tests/hazmat/primitives/test_hmac.py +++ b/tests/hazmat/primitives/test_hmac.py @@ -33,7 +33,7 @@ class TestHMAC(object): ) def test_hmac_reject_unicode(self, backend): - h = hmac.HMAC(b"mykey", hashes.SHA1(), backend=backend) + h = hmac.HMAC(b"mykey", hashes.SHA1(), backend) with pytest.raises(TypeError): h.update(six.u("\u00FC")) @@ -42,17 +42,16 @@ class TestHMAC(object): pretend_backend = pretend.stub(hmacs=pretend_hmac) copied_ctx = pretend.stub() pretend_ctx = pretend.stub(copy=lambda: copied_ctx) - h = hmac.HMAC(b"key", hashes.SHA1(), backend=pretend_backend, - ctx=pretend_ctx) + h = hmac.HMAC(b"key", hashes.SHA1(), pretend_backend, ctx=pretend_ctx) assert h._backend is pretend_backend assert h.copy()._backend is pretend_backend - def test_hmac_algorithm_instance(self): + def test_hmac_algorithm_instance(self, backend): with pytest.raises(TypeError): - hmac.HMAC(b"key", hashes.SHA1) + hmac.HMAC(b"key", hashes.SHA1, backend) - def test_raises_after_finalize(self): - h = hmac.HMAC(b"key", hashes.SHA1()) + def test_raises_after_finalize(self, backend): + h = hmac.HMAC(b"key", hashes.SHA1(), backend) h.finalize() with pytest.raises(AlreadyFinalized): -- cgit v1.2.3 From 9a1b0c75518e6eb2b4c0cb8fd35d94dad124ccd6 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 25 Nov 2013 09:14:02 -0800 Subject: Use keyword argument forms everywhere. --- tests/hazmat/primitives/test_hmac.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/hazmat/primitives/test_hmac.py') diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py index 622f186a..992bcb1a 100644 --- a/tests/hazmat/primitives/test_hmac.py +++ b/tests/hazmat/primitives/test_hmac.py @@ -33,7 +33,7 @@ class TestHMAC(object): ) def test_hmac_reject_unicode(self, backend): - h = hmac.HMAC(b"mykey", hashes.SHA1(), backend) + h = hmac.HMAC(b"mykey", hashes.SHA1(), backend=backend) with pytest.raises(TypeError): h.update(six.u("\u00FC")) @@ -42,16 +42,17 @@ class TestHMAC(object): pretend_backend = pretend.stub(hmacs=pretend_hmac) copied_ctx = pretend.stub() pretend_ctx = pretend.stub(copy=lambda: copied_ctx) - h = hmac.HMAC(b"key", hashes.SHA1(), pretend_backend, ctx=pretend_ctx) + h = hmac.HMAC(b"key", hashes.SHA1(), backend=pretend_backend, + ctx=pretend_ctx) assert h._backend is pretend_backend assert h.copy()._backend is pretend_backend def test_hmac_algorithm_instance(self, backend): with pytest.raises(TypeError): - hmac.HMAC(b"key", hashes.SHA1, backend) + hmac.HMAC(b"key", hashes.SHA1, backend=backend) def test_raises_after_finalize(self, backend): - h = hmac.HMAC(b"key", hashes.SHA1(), backend) + h = hmac.HMAC(b"key", hashes.SHA1(), backend=backend) h.finalize() with pytest.raises(AlreadyFinalized): -- cgit v1.2.3