[Zope3-checkins] CVS: Zope3/src/zope/tal/tests - test_xmlparser.py:1.1.2.3
Fred L. Drake, Jr.
fred@zope.com
Tue, 24 Dec 2002 10:38:01 -0500
Update of /cvs-repository/Zope3/src/zope/tal/tests
In directory cvs.zope.org:/tmp/cvs-serv29704
Modified Files:
Tag: NameGeddon-branch
test_xmlparser.py
Log Message:
update to current Zope 3 test style
=== Zope3/src/zope/tal/tests/test_xmlparser.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/tal/tests/test_xmlparser.py:1.1.2.2 Mon Dec 23 15:38:28 2002
+++ Zope3/src/zope/tal/tests/test_xmlparser.py Tue Dec 24 10:38:00 2002
@@ -3,14 +3,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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 XMLParser.py."""
@@ -114,7 +114,7 @@
parser.parseString(source)
self.assertRaises(xmlparser.XMLParseError, parse)
- def check_processing_instruction_plus(self):
+ def test_processing_instruction_plus(self):
self._run_check("<?processing instruction?><a/>", [
("pi", "processing", "instruction"),
("starttag", "a", []),
@@ -149,7 +149,7 @@
("endtag", "html"),
])
- def check_bad_nesting(self):
+ def test_bad_nesting(self):
try:
self._run_check("<a><b></a></b>", [
("starttag", "a", []),
@@ -164,7 +164,7 @@
else:
self.fail("expected parse error: bad nesting")
- def check_attr_syntax(self):
+ def test_attr_syntax(self):
output = [
("starttag", "a", ["b", "v", "c", "v"]),
("endtag", "a"),
@@ -174,7 +174,7 @@
self._run_check("""<a\nb\n=\n'v'\nc\n=\n"v"\n/>""", output)
self._run_check("""<a\tb\t=\t'v'\tc\t=\t"v"\t/>""", output)
- def check_attr_values(self):
+ def test_attr_values(self):
self._run_check("""<a b='xxx\n\txxx' c="yyy\t\nyyy" d='\txyz\n'/>""",
[("starttag", "a", ["b", "xxx xxx",
"c", "yyy yyy",
@@ -186,19 +186,19 @@
("endtag", "a"),
])
- def check_attr_entity_replacement(self):
+ def test_attr_entity_replacement(self):
self._run_check("""<a b='&><"''/>""", [
("starttag", "a", ["b", "&><\"'"]),
("endtag", "a"),
])
- def check_attr_funky_names(self):
+ def test_attr_funky_names(self):
self._run_check("""<a a.b='v' c:d='v' e-f='v'/>""", [
("starttag", "a", ["a.b", "v", "c:d", "v", "e-f", "v"]),
("endtag", "a"),
])
- def check_starttag_end_boundary(self):
+ def test_starttag_end_boundary(self):
self._run_check("""<a b='<'/>""", [
("starttag", "a", ["b", "<"]),
("endtag", "a"),
@@ -208,7 +208,7 @@
("endtag", "a"),
])
- def check_buffer_artefacts(self):
+ def test_buffer_artefacts(self):
output = [("starttag", "a", ["b", "<"]), ("endtag", "a")]
self._run_check(["<a b='<'/>"], output)
self._run_check(["<a ", "b='<'/>"], output)
@@ -225,7 +225,7 @@
self._run_check(["<a b='>", "'/>"], output)
self._run_check(["<a b='>'", "/>"], output)
- def check_starttag_junk_chars(self):
+ def test_starttag_junk_chars(self):
self._parse_error("<")
self._parse_error("<>")
self._parse_error("</>")
@@ -245,17 +245,16 @@
self._parse_error("<a foo='>'")
self._parse_error("<a foo='>")
- def check_declaration_junk_chars(self):
+ def test_declaration_junk_chars(self):
self._parse_error("<!DOCTYPE foo $ >")
# Support for the Zope regression test framework:
def test_suite(skipxml=utils.skipxml):
- suite = unittest.TestSuite()
- if not skipxml:
- suite.addTest(unittest.makeSuite(XMLParserTestCase, "check_"))
- return suite
-
+ if skipxml:
+ return unittest.TestSuite()
+ else:
+ return unittest.makeSuite(XMLParserTestCase)
if __name__ == "__main__":
errs = utils.run_suite(test_suite(skipxml=0))