[XML-SIG] minidom changes

Fred L. Drake, Jr. fdrake@acm.org
Thu, 25 Jul 2002 12:18:07 -0400


Mike Olson writes:
 > I'm going to check in my minidom changes so that 0.8 mostly works with
 > XPath and Xslt (I'll explain more latter).  I have a question first. 

The tests fail for me for Python versions 2.0.1, 2.1.3, 2.2.1, and
2.3a0 (CVS).  This is with a completely fresh build of PyXML.

Here's the output of "make check":

------------------------------------------------------------------------
python2.0 setup.py  -q build
python2.1 setup.py  -q build
python2.2 setup.py  -q build
python2.3 setup.py  -q build
cd test && PYTHONPATH=../build/lib.linux-i686-2.0 python2.0 testxml.py
Traceback (most recent call last):
  File "test_minidom.py", line 773, in ?
    func()
  File "test_minidom.py", line 534, in testUserData
    c = n.cloneNode(1)
  File "/home/fdrake/projects/pyxml/xml/build/lib.linux-i686-2.0/_xmlplus/dom/minidom.py", line 186, in cloneNode
    clone = CloneNode(self,deep,self.ownerDocument or self)
  File "/home/fdrake/projects/pyxml/xml/build/lib.linux-i686-2.0/_xmlplus/dom/minidom.py", line 1221, in CloneNode
    clone = newOwnerDocument.createElementNS(node.namespaceURI,
  File "/home/fdrake/projects/pyxml/xml/build/lib.linux-i686-2.0/_xmlplus/dom/minicompat.py", line 134, in __getattr__
    raise AttributeError, key
AttributeError: createElementNS
test_c14n
test_dom
test_encodings
test_filter
test_howto
test_htmlb
test_javadom
test_marshal
test test_marshal failed -- Writing: "[None, 1, 10301051460877537453973547267843L, {2: 'eggs', 1: 'spam'}, '<fake tag>', (1+5j), [...]]", expected: "[None, 1, 10301051460877537453973547267843L, {1: 'spam', 2: 'eggs'}, '<fake tag>', (1+5j), [...]]"
test_minidom
test test_minidom failed -- Writing: 'Test Failed: testUserData\012createElementNS\012', expected: ''
test_pyexpat
test_pyxmldom
Warning: can't open ./output/test_pyxmldom
test_sax
test_sax2
test_sax2_xmlproc
test_sax_xmlproc
test_saxdrivers
test_utils
test_xmlbuilder
test_xmlproc
17 tests OK.
2 tests failed: test_marshal test_minidom
cd test && PYTHONPATH=../build/lib.linux-i686-2.1 python2.1 testxml.py
Traceback (most recent call last):
  File "test_minidom.py", line 773, in ?
    func()
  File "test_minidom.py", line 534, in testUserData
    c = n.cloneNode(1)
  File "/home/fdrake/projects/pyxml/xml/build/lib.linux-i686-2.1/_xmlplus/dom/minidom.py", line 186, in cloneNode
    clone = CloneNode(self,deep,self.ownerDocument or self)
  File "/home/fdrake/projects/pyxml/xml/build/lib.linux-i686-2.1/_xmlplus/dom/minidom.py", line 1221, in CloneNode
    clone = newOwnerDocument.createElementNS(node.namespaceURI,
  File "/home/fdrake/projects/pyxml/xml/build/lib.linux-i686-2.1/_xmlplus/dom/minicompat.py", line 134, in __getattr__
    raise AttributeError, key
AttributeError: createElementNS
test_c14n
test_dom
test_encodings
test_filter
test_howto
test_htmlb
test_javadom
test_marshal
test test_marshal failed -- Writing: "[None, 1, 10301051460877537453973547267843L, {2: 'eggs', 1: 'spam'}, '<fake tag>', (1+5j), [...]]", expected: "[None, 1, 10301051460877537453973547267843L, {1: 'spam', 2: 'eggs'}, '<fake tag>', (1+5j), [...]]"
test_minidom
test test_minidom failed -- Writing: 'Test Failed: testUserData\ncreateElementNS\n', expected: ''
test_pyexpat
test_pyxmldom
Warning: can't open ./output/test_pyxmldom
test_sax
test_sax2
test_sax2_xmlproc
test_sax_xmlproc
test_saxdrivers
test_utils
test_xmlbuilder
test_xmlproc
17 tests OK.
2 tests failed: test_marshal test_minidom
cd test && PYTHONPATH=../build/lib.linux-i686-2.2 python2.2 testxml.py
Traceback (most recent call last):
  File "test_minidom.py", line 773, in ?
    func()
  File "test_minidom.py", line 247, in testGetElementsByTagNameNS
    confirm(len(elem) == 1)
  File "test_minidom.py", line 25, in confirm
    print "Failed " + testname
  File "regrtest.py", line 205, in write
    raise test_support.TestFailed, \
TestFailed: Writing: 'Failed Test', expected: ''
test_c14n
test_dom
test_encodings
test_filter
test_howto
test_htmlb
test_javadom
test_marshal
test_minidom
test test_minidom failed -- Writing: "Test Failed: testGetElementsByTagNameNS\nWriting: 'Failed Test', expected: ''\n", expected: ''
test_pyexpat
test_pyxmldom
Warning: can't open ./output/test_pyxmldom
test_sax
test_sax2
test_sax2_xmlproc
test_sax_xmlproc
test_saxdrivers
test_utils
test_xmlbuilder
test test_xmlbuilder crashed -- exceptions.AssertionError : 
[(('http://www.w3.org/2000/xmlns/', None), u'http://xml.python.org/a'),
 (('http://www.w3.org/2000/xmlns/', None), u'http://xml.python.org/a'),
 (('http://www.w3.org/2000/xmlns/', None), u'http://xml.python.org/b'),
 ((u'http://xml.python.org/a', None), u'a'),
 ((u'http://xml.python.org/b', None), u'b')]
test_xmlproc
17 tests OK.
2 tests failed: test_minidom test_xmlbuilder
cd test && PYTHONPATH=../build/lib.linux-i686-2.3 python2.3 testxml.py
Traceback (most recent call last):
  File "test_minidom.py", line 773, in ?
    func()
  File "test_minidom.py", line 247, in testGetElementsByTagNameNS
    confirm(len(elem) == 1)
  File "test_minidom.py", line 25, in confirm
    print "Failed " + testname
  File "regrtest.py", line 205, in write
    raise test_support.TestFailed, \
TestFailed: Writing: 'Failed Test', expected: ''
test_c14n
test_dom
test_encodings
test_filter
test_howto
test_htmlb
test_javadom
test_marshal
test_minidom
test test_minidom failed -- Writing: "Test Failed: testGetElementsByTagNameNS\nWriting: 'Failed Test', expected: ''\n", expected: ''
test_pyexpat
test_pyxmldom
Warning: can't open ./output/test_pyxmldom
test_sax
test_sax2
test_sax2_xmlproc
test_sax_xmlproc
test_saxdrivers
test_utils
test_xmlbuilder
test test_xmlbuilder crashed -- exceptions.AssertionError : 
[(('http://www.w3.org/2000/xmlns/', None), u'http://xml.python.org/a'),
 (('http://www.w3.org/2000/xmlns/', None), u'http://xml.python.org/a'),
 (('http://www.w3.org/2000/xmlns/', None), u'http://xml.python.org/b'),
 ((u'http://xml.python.org/a', None), u'a'),
 ((u'http://xml.python.org/b', None), u'b')]
test_xmlproc
17 tests OK.
2 tests failed: test_minidom test_xmlbuilder
------------------------------------------------------------------------

(I'd *really* like to see the PyXML tests all be converted to use
unittest, but haven't had the time to deal with that yet.  ;-(  )


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation