[Zope-CVS] CVS: Packages/pypes/pypes/tests - test_expression.py:1.6
Casey Duncan
casey at zope.com
Wed Mar 10 16:14:27 EST 2004
Update of /cvs-repository/Packages/pypes/pypes/tests
In directory cvs.zope.org:/tmp/cvs-serv19695/tests
Modified Files:
test_expression.py
Log Message:
Add test for freeNames() method
=== Packages/pypes/pypes/tests/test_expression.py 1.5 => 1.6 ===
--- Packages/pypes/pypes/tests/test_expression.py:1.5 Mon Mar 1 01:36:16 2004
+++ Packages/pypes/pypes/tests/test_expression.py Wed Mar 10 16:14:27 2004
@@ -44,10 +44,19 @@
def testExprNames(self):
e = Expression('Yodel.a["hee"] == str(hoo)')
self.assertEqual(e.names(), Set(['Yodel', 'hoo', 'str']))
-
+
+ def testExprFreeNames(self):
+ e = Expression('Yodel.a["hee"] == str(hoo)')
+ self.assertEqual(e.freeNames(), Set(['Yodel', 'hoo']))
+ self.assertEqual(e.freeNames(['str']), Set(['Yodel', 'hoo', 'str']))
+
def testExprOneName(self):
e = Expression('x')
self.assertEqual(e.names(), Set(['x']))
+
+ def testExprOneFreeName(self):
+ e = Expression('x')
+ self.assertEqual(e.freeNames(), Set(['x']))
def testExprFreeOperands(self):
e = Expression('x.foo == 1 and y or len(z) in (2,3) and (x == y) < 1',
More information about the Zope-CVS
mailing list