[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/tal/tests/test_talparser.py add test for collector issue 133

Fred L. Drake, Jr. fred at zope.com
Tue Jul 6 16:18:47 EDT 2004


Log message for revision 26138:
add test for collector issue 133


-=-
Added: Zope3/branches/ZopeX3-3.0/src/zope/tal/tests/test_talparser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/tal/tests/test_talparser.py	2004-07-06 19:43:45 UTC (rev 26137)
+++ Zope3/branches/ZopeX3-3.0/src/zope/tal/tests/test_talparser.py	2004-07-06 20:18:47 UTC (rev 26138)
@@ -0,0 +1,39 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Tests for zope.tal.talparser.
+
+$Id$
+"""
+import unittest
+
+from zope.tal import talparser
+
+
+class TALParserTestCase(unittest.TestCase):
+
+    def test_parser_returns_macros(self):
+        parser = talparser.TALParser()
+        parser.parseString(
+            "<?xml version='1.0'?>\n"
+            "<doc xmlns:metal='http://xml.zope.org/namespaces/metal'>\n"
+            "  <m metal:define-macro='MACRO'>\n"
+            "    <para>some text</para>\n"
+            "  </m>\n"
+            "</doc>")
+        bytecode, macros = parser.getCode()
+        self.assertEqual(macros.keys(), ["MACRO"])
+
+
+def test_suite():
+    return unittest.makeSuite(TALParserTestCase)


Property changes on: Zope3/branches/ZopeX3-3.0/src/zope/tal/tests/test_talparser.py
___________________________________________________________________
Name: svn:mime-type
   + text/x-python
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list