diff options
author | Armin Rigo <arigo@tunes.org> | 2015-12-11 05:16:46 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2015-12-11 05:16:46 +0100 |
commit | 77abae7920dc5e7d55a8606acbc0824ffbac61a7 (patch) | |
tree | b79557722370a6b76e35b73baf8f804ce9efae1b /testing | |
parent | d303891294c76eee4680084ab11ff550c6c9b5f1 (diff) | |
download | cffi-77abae7920dc5e7d55a8606acbc0824ffbac61a7.tar.gz |
Add a __class__ attribute on lib objects
Diffstat (limited to 'testing')
-rw-r--r-- | testing/cffi1/test_ffi_obj.py | 2 | ||||
-rw-r--r-- | testing/cffi1/test_recompiler.py | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/testing/cffi1/test_ffi_obj.py b/testing/cffi1/test_ffi_obj.py index 01a26d9..4002e9d 100644 --- a/testing/cffi1/test_ffi_obj.py +++ b/testing/cffi1/test_ffi_obj.py @@ -7,6 +7,7 @@ def test_ffi_new(): p = ffi.new("int *") p[0] = -42 assert p[0] == -42 + assert type(ffi) is ffi.__class__ is _cffi1_backend.FFI def test_ffi_subclass(): class FOO(_cffi1_backend.FFI): @@ -16,6 +17,7 @@ def test_ffi_subclass(): assert foo.x == 42 p = foo.new("int *") assert p[0] == 0 + assert type(foo) is foo.__class__ is FOO def test_ffi_no_argument(): py.test.raises(TypeError, _cffi1_backend.FFI, 42) diff --git a/testing/cffi1/test_recompiler.py b/testing/cffi1/test_recompiler.py index 61693c8..7d85de9 100644 --- a/testing/cffi1/test_recompiler.py +++ b/testing/cffi1/test_recompiler.py @@ -1156,6 +1156,7 @@ def test_import_from_lib(): assert hasattr(lib, '__dict__') assert lib.__all__ == ['MYFOO', 'mybar'] # but not 'myvar' assert lib.__name__ == repr(lib) + assert lib.__class__ is type(lib) def test_macro_var_callback(): ffi = FFI() |