Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a84a33

Browse files
committed
Add .toxml test case, as proposed by Alex Martelli in bug report #116244.
1 parent 2c8a89c commit 0a84a33

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/test/output/test_minidom

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,6 @@ Test Succeeded testTooManyDocumentElements
103103
Passed Test
104104
Test Succeeded testUnlink
105105
Test Succeeded testWriteText
106+
Passed Test
106107
Test Succeeded testWriteXML
107108
All tests succeeded

Lib/test/test_minidom.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ def testAttributeRepr():
246246

247247
def testTextNodeRepr(): pass
248248

249-
def testWriteXML(): pass
249+
def testWriteXML():
250+
str = '<a b="c"/>'
251+
dom = parseString(str)
252+
domstr = dom.toxml()
253+
dom.unlink()
254+
confirm(str == domstr)
250255

251256
def testProcessingInstruction(): pass
252257

0 commit comments

Comments
 (0)