[ZPT] CVS: Packages/TAL - test_htmlparser.py:1.14
guido@digicool.com
guido@digicool.com
Mon, 9 Apr 2001 11:40:55 -0400 (EDT)
Update of /cvs-repository/Packages/TAL/test
In directory korak:/tmp/cvs-serv1462
Modified Files:
test_htmlparser.py
Log Message:
When the argument to _run_check() is a string, feed it to the parser a
character at a time. This uncovers two new bugs in HTMLParser that
I'm going to attack next.
--- Updated File test_htmlparser.py in package Packages/TAL --
--- test_htmlparser.py 2001/04/09 14:11:05 1.13
+++ test_htmlparser.py 2001/04/09 15:40:54 1.14
@@ -81,12 +81,10 @@
def _run_check(self, source, events, collector=EventCollector):
parser = collector()
parser.feed(self.prologue)
- if isinstance(source, type([])):
- for s in source:
- parser.feed(s)
- else:
- parser.feed(source)
- parser.feed(self.epilogue)
+ for s in source:
+ parser.feed(s)
+ for c in self.epilogue:
+ parser.feed(c)
parser.close()
self.assert_(parser.get_events() ==
self.initial_events + events + self.final_events,
@@ -243,7 +241,6 @@
def check_cdata_content(self):
s = """<script> <!-- not a comment --> ¬-an-entity-ref; </script>"""
- s = list(s)
self._run_check(s, [
("starttag", "script", []),
("data", " <!-- not a comment --> ¬-an-entity-ref; "),