summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-07-07 20:09:09 +0000
committerFred Drake <fdrake@acm.org>2004-07-07 20:09:09 +0000
commit40af0cfe243d0fa080825f3c523a87e7cb948ece (patch)
tree08c41449ecdada556244dbdaff806b44da2b3526
parent25b05199aedb746bd857181bc50b15b741fd2c46 (diff)
downloadzope-tal-40af0cfe243d0fa080825f3c523a87e7cb948ece.tar.gz
add test for collector issue 133
(Merged from ZopeX3-3.0 branch revision 26138.)
-rw-r--r--tests/test_talparser.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/test_talparser.py b/tests/test_talparser.py
new file mode 100644
index 0000000..f159cc1
--- /dev/null
+++ b/tests/test_talparser.py
@@ -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)