Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ad4a558a
Commit
ad4a558a
authored
Dec 31, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test case for legal DOM children
parent
291ed4fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
Lib/test/output/test_minidom
Lib/test/output/test_minidom
+3
-1
Lib/test/test_minidom.py
Lib/test/test_minidom.py
+25
-1
No files found.
Lib/test/output/test_minidom
View file @
ad4a558a
...
...
@@ -76,7 +76,7 @@ Test Succeeded testClonePIShallow
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testComment
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCreatAttributeNS
Test Succeeded testCreat
e
AttributeNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCreateElementNS
Passed assertion: len(Node.allnodes) == 0
...
...
@@ -121,6 +121,8 @@ Passed testInsertBefore -- node properly placed in tree
Passed testInsertBefore -- node properly placed in tree
Test Succeeded testInsertBefore
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testLegalChildren
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testNonZero
...
...
Lib/test/test_minidom.py
View file @
ad4a558a
...
...
@@ -76,6 +76,30 @@ def testAppendChild():
confirm
(
dom
.
documentElement
.
childNodes
[
-
1
].
data
==
"Hello"
)
dom
.
unlink
()
def
testLegalChildren
():
dom
=
Document
()
elem
=
dom
.
createElement
(
'element'
)
text
=
dom
.
createTextNode
(
'text'
)
try
:
dom
.
appendChild
(
text
)
except
HierarchyRequestErr
:
pass
else
:
print
"dom.appendChild didn't raise HierarchyRequestErr"
dom
.
appendChild
(
elem
)
try
:
dom
.
insertBefore
(
text
,
elem
)
except
HierarchyRequestErr
:
pass
else
:
print
"dom.appendChild didn't raise HierarchyRequestErr"
try
:
dom
.
replaceChild
(
text
,
elem
)
except
HierarchyRequestErr
:
pass
else
:
print
"dom.appendChild didn't raise HierarchyRequestErr"
elem
.
appendChild
(
text
)
dom
.
unlink
()
def
testNonZero
():
dom
=
parse
(
tstfile
)
confirm
(
dom
)
# should not be zero
...
...
@@ -279,7 +303,7 @@ def testTooManyDocumentElements():
def
testCreateElementNS
():
pass
def
testCreatAttributeNS
():
pass
def
testCreat
e
AttributeNS
():
pass
def
testParse
():
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment