Commit 53855c64 authored by Neal Norwitz's avatar Neal Norwitz

Remove the xmllib module that was obsolete.

parent e6c6e3d9
...@@ -522,8 +522,7 @@ then the module functions are probably more convenient. If a program ...@@ -522,8 +522,7 @@ then the module functions are probably more convenient. If a program
contains a lot of regular expressions, or re-uses the same ones in contains a lot of regular expressions, or re-uses the same ones in
several locations, then it might be worthwhile to collect all the several locations, then it might be worthwhile to collect all the
definitions in one place, in a section of code that compiles all the definitions in one place, in a section of code that compiles all the
REs ahead of time. To take an example from the standard library, REs ahead of time. To take an example from the standard library:
here's an extract from \file{xmllib.py}:
\begin{verbatim} \begin{verbatim}
ref = re.compile( ... ) ref = re.compile( ... )
......
...@@ -171,7 +171,6 @@ and how to embed it in other applications. ...@@ -171,7 +171,6 @@ and how to embed it in other applications.
\input{xmlsaxutils} \input{xmlsaxutils}
\input{xmlsaxreader} \input{xmlsaxreader}
\input{libetree} \input{libetree}
% \input{libxmllib}
\input{fileformats} % Miscellaneous file formats \input{fileformats} % Miscellaneous file formats
\input{libcsv} \input{libcsv}
......
This diff is collapsed.
'''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>
"""
nsdoc = "<foo xmlns='URI' attr='val'/>"
import warnings
warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
DeprecationWarning, r'xmllib$')
from test import test_support
import unittest
import xmllib
class XMLParserTestCase(unittest.TestCase):
def test_simple(self):
parser = xmllib.XMLParser()
for c in testdoc:
parser.feed(c)
parser.close()
def test_default_namespace(self):
class H(xmllib.XMLParser):
def unknown_starttag(self, name, attr):
self.name, self.attr = name, attr
h=H()
h.feed(nsdoc)
h.close()
# The default namespace applies to elements...
self.assertEquals(h.name, "URI foo")
# but not to attributes
self.assertEquals(h.attr, {'attr':'val'})
def test_main():
test_support.run_unittest(XMLParserTestCase)
if __name__ == "__main__":
test_main()
...@@ -17,5 +17,4 @@ runtest("test.test_pyexpat") ...@@ -17,5 +17,4 @@ runtest("test.test_pyexpat")
runtest("test.test_sax") runtest("test.test_sax")
runtest("test.test_xml_etree") runtest("test.test_xml_etree")
runtest("test.test_xml_etree_c") runtest("test.test_xml_etree_c")
runtest("test.test_xmllib")
runtest("test.test_xmlrpc") runtest("test.test_xmlrpc")
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment