[Zope-CVS] CVS: Packages/pypes/pypes/tests - test_expression.py:1.11

Casey Duncan casey at zope.com
Tue May 11 23:48:49 EDT 2004


Update of /cvs-repository/Packages/pypes/pypes/tests
In directory cvs.zope.org:/tmp/cvs-serv17598/tests

Modified Files:
	test_expression.py 
Log Message:
Implement makeFunction() method for expressions


=== Packages/pypes/pypes/tests/test_expression.py 1.10 => 1.11 ===
--- Packages/pypes/pypes/tests/test_expression.py:1.10	Tue May  4 23:37:40 2004
+++ Packages/pypes/pypes/tests/test_expression.py	Tue May 11 23:48:48 2004
@@ -183,6 +183,13 @@
         left2, right2 = e.ast().getChildNodes()[0].getChildNodes()
         self.failIf(left is left2)
         self.failIf(right is right2)
+        
+    def testMakeFunction(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)
 
 
 class WhiteTestExpression(unittest.TestCase):




More information about the Zope-CVS mailing list