Revert a change to a unit test that would assert that the results of hybrid

path expressions where the alternate expression wasn't a PathExpr is not called.
See http://www.zope.org/Collectors/Zope/538, http://svn.zope.org/?view=rev&rev=22855
and http://www.zope.org/Collectors/Zope3-dev/638.
parent 9883ffc6
......@@ -116,6 +116,8 @@ class ZopePathExpr(PathExpr):
else:
# On the last subexpression allow exceptions through.
ob = self._subexprs[-1](econtext)
if self._hybrid:
return ob
if self._name == 'nocall':
return ob
......
......@@ -76,7 +76,7 @@ class ExpressionTests(unittest.TestCase):
'''Test hybrid path expressions'''
ec = self.ec
assert ec.evaluate('x | python:1+1') == 2
assert ec.evaluate('x | python:int') == 0
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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment