blob: a1c5057e773b900be8224ed1c8e225c27c0cad81 [file] [log] [blame]
Guido van Rossum02505e41998-01-29 14:55:24 +00001'''Test module to thest the xmllib module.
2 Sjoerd Mullender
3'''
4
Guido van Rossum02505e41998-01-29 14:55:24 +00005testdoc = """\
6<?xml version="1.0" encoding="UTF-8" standalone='yes' ?>
7<!-- comments aren't allowed before the <?xml?> tag,
8 but they are allowed before the <!DOCTYPE> tag -->
Fred Drakebabd7372001-05-22 20:22:06 +00009<?processing instructions are allowed in the same places as comments ?>
Guido van Rossum02505e41998-01-29 14:55:24 +000010<!DOCTYPE greeting [
11 <!ELEMENT greeting (#PCDATA)>
12]>
13<greeting>Hello, world!</greeting>
14"""
15
Fred Drakebabd7372001-05-22 20:22:06 +000016import test_support
17import unittest
Guido van Rossum02505e41998-01-29 14:55:24 +000018import xmllib
Guido van Rossum02505e41998-01-29 14:55:24 +000019
Fred Drakebabd7372001-05-22 20:22:06 +000020
21class XMLParserTestCase(unittest.TestCase):
22
23 def test_simple(self):
24 parser = xmllib.XMLParser()
25 for c in testdoc:
26 parser.feed(c)
27 parser.close()
28
29
30test_support.run_unittest(XMLParserTestCase)