[pypy-svn] r72742 - pypy/branch/cpython-extension/pypy/interpreter/test
afa at codespeak.net
afa at codespeak.net
Wed Mar 24 18:49:55 CET 2010
Author: afa
Date: Wed Mar 24 18:49:54 2010
New Revision: 72742
Modified:
pypy/branch/cpython-extension/pypy/interpreter/test/test_typedef.py
Log:
Add test for r72611
Modified: pypy/branch/cpython-extension/pypy/interpreter/test/test_typedef.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/interpreter/test/test_typedef.py (original)
+++ pypy/branch/cpython-extension/pypy/interpreter/test/test_typedef.py Wed Mar 24 18:49:54 2010
@@ -1,5 +1,6 @@
from pypy.interpreter import typedef
from pypy.tool.udir import udir
+from pypy.interpreter.baseobjspace import Wrappable
# this test isn't so much to test that the objspace interface *works*
# -- it's more to test that it's *there*
@@ -132,6 +133,17 @@
assert len(set) <= 6, "%s has %d subclasses:\n%r" % (
cls, len(set), [subcls.__name__ for subcls in set])
+ def test_getsetproperty(self):
+ class W_SomeType(Wrappable):
+ pass
+ def fget(self, space, w_self):
+ assert self is prop
+ W_SomeType.typedef = typedef.TypeDef(
+ 'some_type',
+ x=typedef.GetSetProperty(fget, use_closure=True))
+ w_obj = self.space.wrap(W_SomeType())
+ assert self.space.getattr(w_obj, self.space.wrap('x')) is None
+
class AppTestTypeDef:
More information about the Pypy-commit
mailing list