[Zope-CVS] CVS: Packages/pypes/pypes/tests - test_expression.py:1.12
Casey Duncan
casey at zope.com
Tue May 11 23:58:41 EDT 2004
Update of /cvs-repository/Packages/pypes/pypes/tests
In directory cvs.zope.org:/tmp/cvs-serv19484/tests
Modified Files:
test_expression.py
Log Message:
allow makeFunction access to expression bindings
=== Packages/pypes/pypes/tests/test_expression.py 1.11 => 1.12 ===
--- Packages/pypes/pypes/tests/test_expression.py:1.11 Tue May 11 23:48:48 2004
+++ Packages/pypes/pypes/tests/test_expression.py Tue May 11 23:58:41 2004
@@ -184,12 +184,18 @@
self.failIf(left is left2)
self.failIf(right is right2)
- def testMakeFunction(self):
+ def testMakeFunctionSimple(self):
e = Expression('x < y')
f = e.makeFunction(args=['x', 'y'])
self.failUnless(f(1, 2))
self.failIf(f(x=2, y=1))
self.assertRaises(TypeError, f, 5)
+
+ def testMakeFunctionWithBindings(self):
+ e = Expression('z < len(foo)', {'foo': [1,2,3]})
+ f = e.makeFunction(args=['z'])
+ self.failUnless(f(1))
+ self.failIf(f(z=6))
class WhiteTestExpression(unittest.TestCase):
More information about the Zope-CVS
mailing list