Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r55939:24cab6798049
Date: 2012-07-05 16:14 -0700
http://bitbucket.org/pypy/pypy/changeset/24cab6798049/

Log:    add test for use of unbound methods

diff --git a/pypy/module/cppyy/test/test_pythonify.py 
b/pypy/module/cppyy/test/test_pythonify.py
--- a/pypy/module/cppyy/test/test_pythonify.py
+++ b/pypy/module/cppyy/test/test_pythonify.py
@@ -309,6 +309,20 @@
         assert hasattr(z, 'myint')
         assert z.gime_z_(z)
 
+    def test14_bound_unbound_calls(self):
+        """Test (un)bound method calls"""
+
+        import cppyy
+
+        raises(TypeError, cppyy.gbl.example01.addDataToInt, 1)
+
+        meth = cppyy.gbl.example01.addDataToInt
+        raises(TypeError, meth)
+        raises(TypeError, meth, 1)
+
+        e = cppyy.gbl.example01(2)
+        assert 5 == meth(e, 3)
+
 
 class AppTestPYTHONIFY_UI:
     def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to