test_xmllib.py

来自「mallet是自然语言处理、机器学习领域的一个开源项目。」· Python 代码 · 共 36 行

PY
36
字号
'''Test module to thest the xmllib module.   Sjoerd Mullender'''testdoc = """\<?xml version="1.0" encoding="UTF-8" standalone='yes' ?><!-- comments aren't allowed before the <?xml?> tag,     but they are allowed before the <!DOCTYPE> tag --><?processing instructions are allowed in the same places as comments ?><!DOCTYPE greeting [  <!ELEMENT greeting (#PCDATA)>]><greeting>Hello, world!</greeting>"""import test_supportimport unittestimport xmllibclass XMLParserTestCase(unittest.TestCase):    def test_simple(self):        parser = xmllib.XMLParser()        for c in testdoc:            parser.feed(c)        parser.close()def test_main():    test_support.run_unittest(XMLParserTestCase)if __name__ == "__main__":    test_main()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?