Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f27f5ab3
Kaydet (Commit)
f27f5ab3
authored
Eki 11, 2000
tarafından
Lars Gustäbel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added additional test cases for pulldom modifications.
üst
bc1b5c81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 deletion
+77
-1
test_minidom
Lib/test/output/test_minidom
+10
-0
test_minidom.py
Lib/test/test_minidom.py
+67
-1
No files found.
Lib/test/output/test_minidom
Dosyayı görüntüle @
f27f5ab3
...
...
@@ -110,10 +110,17 @@ Test Succeeded testHasChildNodes
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testInsertBefore
Passed assertion: len(Node.allnodes) == 0
Passed testNonNSElements - siblings
Passed testNonNSElements - parents
Test Succeeded testNonNSElements
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testNonZero
Passed assertion: len(Node.allnodes) == 0
Passed testParents
Test Succeeded testParents
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParse
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseAttributeNamespaces
...
...
@@ -149,6 +156,9 @@ Test Succeeded testRemoveAttributeNode
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testSetAttrValueandNodeValue
Passed assertion: len(Node.allnodes) == 0
Passed testSiblings
Test Succeeded testSiblings
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testTextNodeRepr
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testTextRepr
...
...
Lib/test/test_minidom.py
Dosyayı görüntüle @
f27f5ab3
...
...
@@ -308,7 +308,73 @@ def testClonePIShallow(): pass
def
testClonePIDeep
():
pass
def
testSiblings
():
doc
=
parseString
(
"<doc><?pi?>text?<elm/></doc>"
)
root
=
doc
.
documentElement
(
pi
,
text
,
elm
)
=
root
.
childNodes
confirm
(
pi
.
nextSibling
is
text
and
pi
.
previousSibling
is
None
and
text
.
nextSibling
is
elm
and
text
.
previousSibling
is
pi
and
elm
.
nextSibling
is
None
and
elm
.
previousSibling
is
text
,
"testSiblings"
)
doc
.
unlink
()
def
testParents
():
doc
=
parseString
(
"<doc><elm1><elm2/><elm2><elm3/></elm2></elm1></doc>"
)
root
=
doc
.
documentElement
elm1
=
root
.
childNodes
[
0
]
(
elm2a
,
elm2b
)
=
elm1
.
childNodes
elm3
=
elm2b
.
childNodes
[
0
]
confirm
(
root
.
parentNode
is
doc
and
elm1
.
parentNode
is
root
and
elm2a
.
parentNode
is
elm1
and
elm2b
.
parentNode
is
elm1
and
elm3
.
parentNode
is
elm2b
,
"testParents"
)
doc
.
unlink
()
def
testNonNSElements
():
from
xml.dom
import
pulldom
pulldom
=
pulldom
.
PullDOM
()
pulldom
.
startDocument
()
pulldom
.
startElement
(
"doc"
,
{})
pulldom
.
characters
(
"text"
)
pulldom
.
startElement
(
"subelm"
,
{})
pulldom
.
characters
(
"text"
)
pulldom
.
endElement
(
"subelm"
)
pulldom
.
characters
(
"text"
)
pulldom
.
endElement
(
"doc"
)
pulldom
.
endDocument
()
doc
=
pulldom
.
document
root
=
doc
.
documentElement
(
text1
,
elm1
,
text2
)
=
root
.
childNodes
text3
=
elm1
.
childNodes
[
0
]
confirm
(
text1
.
previousSibling
is
None
and
text1
.
nextSibling
is
elm1
and
elm1
.
previousSibling
is
text1
and
elm1
.
nextSibling
is
text2
and
text2
.
previousSibling
is
elm1
and
text2
.
nextSibling
is
None
and
text3
.
previousSibling
is
None
and
text3
.
nextSibling
is
None
,
"testNonNSElements - siblings"
)
confirm
(
root
.
parentNode
is
doc
and
text1
.
parentNode
is
root
and
elm1
.
parentNode
is
root
and
text2
.
parentNode
is
root
and
text3
.
parentNode
is
elm1
,
"testNonNSElements - parents"
)
doc
.
unlink
()
# --- MAIN PROGRAM
names
=
globals
()
.
keys
()
names
.
sort
()
...
...
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