[pypy-svn] r77551 - pypy/branch/fast-forward/pypy/interpreter/test

afa at codespeak.net afa at codespeak.net
Sun Oct 3 22:28:01 CEST 2010


Author: afa
Date: Sun Oct  3 22:27:59 2010
New Revision: 77551

Modified:
   pypy/branch/fast-forward/pypy/interpreter/test/test_argument.py
Log:
Add methods to the DummySpace to let the tests pass


Modified: pypy/branch/fast-forward/pypy/interpreter/test/test_argument.py
==============================================================================
--- pypy/branch/fast-forward/pypy/interpreter/test/test_argument.py	(original)
+++ pypy/branch/fast-forward/pypy/interpreter/test/test_argument.py	Sun Oct  3 22:27:59 2010
@@ -98,12 +98,27 @@
 
     def isinstance(self, obj, cls):
         return isinstance(obj, cls)
+    isinstance_w = isinstance
 
     def exception_match(self, w_type1, w_type2):
         return issubclass(w_type1, w_type2)
 
+    def call_method(self, obj, name, *args):
+        try:
+            method = getattr(obj, name)
+        except AttributeError:
+            raise OperationError(AttributeError, name)
+        return method(*args)
+
+    def type(self, obj):
+        class Type:
+            def getname(self, space, default):
+                return type(obj).__name__
+        return Type()
+
 
     w_TypeError = TypeError
+    w_AttributeError = AttributeError
     w_dict = dict
 
 class TestArgumentsNormal(object):



More information about the Pypy-commit mailing list