[Zope3-checkins] CVS: Zope3/src/zope/app/basicskin/tests -
test_standardmacros.py:1.5
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 23 17:08:30 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/basicskin/tests
In directory cvs.zope.org:/tmp/cvs-serv23219/src/zope/app/basicskin/tests
Modified Files:
test_standardmacros.py
Log Message:
Implement aliases for macros.
=== Zope3/src/zope/app/basicskin/tests/test_standardmacros.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/basicskin/tests/test_standardmacros.py:1.4 Fri Mar 19 15:26:22 2004
+++ Zope3/src/zope/app/basicskin/tests/test_standardmacros.py Tue Mar 23 17:08:29 2004
@@ -58,8 +58,10 @@
'tree':'works_with_page1_tree'}
def createMacrosInstance(pages):
- from zope.app.basicskin.standardmacros import Macros
+
class T(Macros):
+ aliases = {'afoo': 'foo', 'abar': 'bar'}
+
def __init__(self, context, request):
self.context = context
self.request = request
@@ -94,6 +96,12 @@
self.assertEqual(macros['bar'], 'page1_bar')
self.assertEqual(macros['baz'], 'collides_with_page1_baz')
self.assertRaises(KeyError, macros.__getitem__, 'pants')
+
+ def testMacroAliases(self):
+ macros = createMacrosInstance(('page1', 'collides_with_page1'))
+ self.assertEqual(macros['afoo'], 'page1_foo')
+ self.assertEqual(macros['abar'], 'page1_bar')
+
def test_suite():
loader = unittest.TestLoader()
More information about the Zope3-Checkins
mailing list