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

Casey Duncan casey at zope.com
Tue May 4 23:37:41 EDT 2004


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

Modified Files:
	test_expression.py 
Log Message:
Replace IndexRejects with more general CantProcess exception type
Add bindings() method to expressions


=== Packages/pypes/pypes/tests/test_expression.py 1.9 => 1.10 ===
--- Packages/pypes/pypes/tests/test_expression.py:1.9	Thu Apr 29 23:05:02 2004
+++ Packages/pypes/pypes/tests/test_expression.py	Tue May  4 23:37:40 2004
@@ -54,6 +54,13 @@
         e = Expression('Yodel.a["hee"] == str(hoo)')
         self.assertEqual(e.names(), Set(['Yodel', 'hoo', 'str']))
         
+    def testExprBindings(self):
+        ns = {'a': 2, 'b': 'juju'}
+        e = Expression('x == a and y == b', ns)
+        self.assertEqual(e.bindings(), ns)
+        e = Expression('x > y')
+        self.assertEqual(e.bindings(), {})        
+        
     def testExprFreeNames(self):
         e = Expression('Yodel.a["hee"] == str(hoo)')
         self.assertEqual(e.freeNames(), Set(['Yodel', 'hoo']))




More information about the Zope-CVS mailing list