diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-04 17:43:35 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-04 17:43:35 -0600 |
commit | 3ae13fc662435d69c7d93e937a675059164a495c (patch) | |
tree | c70e7657be1e06a992ffa479bd98c3fe7f1f703f /tests/test_utils.py | |
parent | 108605b01873c4176275cc6bf2ea0d0b7c447a0e (diff) | |
download | cryptography-3ae13fc662435d69c7d93e937a675059164a495c.tar.gz cryptography-3ae13fc662435d69c7d93e937a675059164a495c.tar.bz2 cryptography-3ae13fc662435d69c7d93e937a675059164a495c.zip |
fix py3
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 917e87f0..6f938f58 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -33,6 +33,16 @@ class FakeInterface(object): pass +class FakeBinding(object): + @classmethod + def _ensure_ffi_initialized(cls): + raise cffi.VerificationError + + @classmethod + def is_available(cls): + return binding_available(cls._ensure_ffi_initialized) + + def test_check_for_iface(): item = pretend.stub(keywords=["fake_name"], funcargs={"backend": True}) with pytest.raises(pytest.skip.Exception) as exc_info: @@ -84,15 +94,6 @@ def test_check_binding_available(): def test_check_binding_unavailable(): - class FakeBinding(object): - @classmethod - def _ensure_ffi_initialized(cls): - raise cffi.VerificationError - - @classmethod - def is_available(cls): - return binding_available(cls._ensure_ffi_initialized) - kwargs = pretend.stub(kwargs={"binding": FakeBinding}) item = pretend.stub(keywords={"binding_available": kwargs}) with pytest.raises(pytest.skip.Exception) as exc_info: |