append(): Fixing the test for convertability after consultation with
[python/dscho.git] / Lib / test / test_xmllib.py
blobb14ead9aa06e212a87bfb4d06a8dbc0174bbcfe8
1 '''Test module to thest the xmllib module.
2 Sjoerd Mullender
3 '''
5 testdoc = """\
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 -->
9 <?processing instructions are allowed in the same places as comments ?>
10 <!DOCTYPE greeting [
11 <!ELEMENT greeting (#PCDATA)>
13 <greeting>Hello, world!</greeting>
14 """
16 import warnings
17 warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
18 DeprecationWarning, r'xmllib$')
20 from test import test_support
21 import unittest
22 import xmllib
24 class XMLParserTestCase(unittest.TestCase):
26 def test_simple(self):
27 parser = xmllib.XMLParser()
28 for c in testdoc:
29 parser.feed(c)
30 parser.close()
33 def test_main():
34 test_support.run_unittest(XMLParserTestCase)
36 if __name__ == "__main__":
37 test_main()