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

Skip to content

Commit 3277da0

Browse files
committed
Update the test suite to cover more ground.
This closes patch #102477.
1 parent f7cf40d commit 3277da0

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/test/output/test_minidom

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Test Succeeded testNonZero
127127
Passed assertion: len(Node.allnodes) == 0
128128
Passed testNormalize -- preparation
129129
Passed testNormalize -- result
130+
Passed testNormalize -- single empty node removed
130131
Test Succeeded testNormalize
131132
Passed assertion: len(Node.allnodes) == 0
132133
Passed testParents

Lib/test/test_minidom.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,14 @@ def testNormalize():
397397
, "testNormalize -- result")
398398
doc.unlink()
399399

400+
doc = parseString("<doc/>")
401+
root = doc.documentElement
402+
root.appendChild(doc.createTextNode(""))
403+
doc.normalize()
404+
confirm(len(root.childNodes) == 0,
405+
"testNormalize -- single empty node removed")
406+
doc.unlink()
407+
400408
def testSiblings():
401409
doc = parseString("<doc><?pi?>text?<elm/></doc>")
402410
root = doc.documentElement

0 commit comments

Comments
 (0)