[pypy-svn] r57136 - pypy/branch/garden-call-code/pypy/interpreter/test
pedronis at codespeak.net
pedronis at codespeak.net
Sat Aug 9 16:49:38 CEST 2008
Author: pedronis
Date: Sat Aug 9 16:49:36 2008
New Revision: 57136
Modified:
pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py
Log:
reorganize tests
Modified: pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py
==============================================================================
--- pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py (original)
+++ pypy/branch/garden-call-code/pypy/interpreter/test/test_gateway.py Sat Aug 9 16:49:36 2008
@@ -459,7 +459,38 @@
assert space.is_true(w_res)
assert called == [w_app_f, w_app_f]
+
+ def test_plain(self):
+ space = self.space
+
+ def g(space, w_a, w_x):
+ return space.newtuple([space.wrap('g'), w_a, w_x])
+
+ w_g = space.wrap(gateway.interp2app_temp(g,
+ unwrap_spec=[gateway.ObjSpace,
+ gateway.W_Root,
+ gateway.W_Root]))
+
+ args = argument.Arguments(space, [space.wrap(-1), space.wrap(0)])
+
+ w_res = space.call_args(w_g, args)
+ assert space.is_true(space.eq(w_res, space.wrap(('g', -1, 0))))
+
+ w_self = space.wrap('self')
+
+ args0 = argument.Arguments(space, [space.wrap(0)])
+ args = args0.prepend(w_self)
+
+ w_res = space.call_args(w_g, args)
+ assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 0))))
+
+ args3 = argument.Arguments(space, [space.wrap(3)])
+ w_res = space.call_obj_args(w_g, w_self, args3)
+ assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 3))))
+
+class TestPassThroughArguments:
+
def test_pass_trough_arguments(self):
space = self.space
@@ -507,34 +538,6 @@
w_res = space.call_args(w_g, args)
assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 0))))
-
- def test_plain(self):
- space = self.space
-
- def g(space, w_a, w_x):
- return space.newtuple([space.wrap('g'), w_a, w_x])
-
- w_g = space.wrap(gateway.interp2app_temp(g,
- unwrap_spec=[gateway.ObjSpace,
- gateway.W_Root,
- gateway.W_Root]))
-
- args = argument.Arguments(space, [space.wrap(-1), space.wrap(0)])
-
- w_res = space.call_args(w_g, args)
- assert space.is_true(space.eq(w_res, space.wrap(('g', -1, 0))))
-
- w_self = space.wrap('self')
-
- args0 = argument.Arguments(space, [space.wrap(0)])
- args = args0.prepend(w_self)
-
- w_res = space.call_args(w_g, args)
- assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 0))))
-
- args3 = argument.Arguments(space, [space.wrap(3)])
- w_res = space.call_obj_args(w_g, w_self, args3)
- assert space.is_true(space.eq(w_res, space.wrap(('g', 'self', 3))))
class AppTestKeywordsToBuiltinSanity(object):
More information about the Pypy-commit
mailing list