[ZPT] CVS: Releases/Zope/lib/python/Products/PageTemplates/tests - testExpressions.py:1.11

Evan Simpson evan@zope.com
Thu, 26 Sep 2002 17:33:18 -0400


Update of /cvs-repository/Releases/Zope/lib/python/Products/PageTemplates/tests
In directory cvs.zope.org:/tmp/cvs-serv7693/lib/python/Products/PageTemplates/tests

Modified Files:
	testExpressions.py 
Log Message:
Fix Collector #538.  Path expressions with a non-path final alternate no
longer try to call a value returned by that alternate.


=== Releases/Zope/lib/python/Products/PageTemplates/tests/testExpressions.py 1.10 => 1.11 ===
--- Releases/Zope/lib/python/Products/PageTemplates/tests/testExpressions.py:1.10	Wed Sep 25 18:57:55 2002
+++ Releases/Zope/lib/python/Products/PageTemplates/tests/testExpressions.py	Thu Sep 26 17:33:17 2002
@@ -43,6 +43,15 @@
         assert ec.evaluate('d/ | nothing') == 'blank'
         assert ec.evaluate('d/?blank') == 'blank'
 
+    def testHybrid(self):
+        '''Test hybrid path expressions'''
+        ec = self.ec
+        assert ec.evaluate('x | python:1+1') == 2
+        assert ec.evaluate('x | python:int') == int
+        assert ec.evaluate('x | string:x') == 'x'
+        assert ec.evaluate('x | string:$one') == '1'
+        assert ec.evaluate('x | not:exists:x')
+
 def test_suite():
     return unittest.makeSuite(ExpressionTests)