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
80670bca
Kaydet (Commit)
80670bca
authored
Eki 06, 2000
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a test case for reporting the file name, and for reporting an error
for incomplete input.
üst
31b485ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
test_sax
Lib/test/output/test_sax
+3
-1
test_sax.py
Lib/test/test_sax.py
+33
-2
No files found.
Lib/test/output/test_sax
Dosyayı görüntüle @
80670bca
...
...
@@ -8,7 +8,9 @@ Passed test_expat_attrs_empty
Passed test_expat_attrs_wattr
Passed test_expat_dtdhandler
Passed test_expat_entityresolver
Passed test_expat_incomplete
Passed test_expat_inpsource_filename
Passed test_expat_inpsource_location
Passed test_expat_inpsource_stream
Passed test_expat_inpsource_sysid
Passed test_expat_nsattrs_empty
...
...
@@ -23,4 +25,4 @@ Passed test_xmlgen_content_escape
Passed test_xmlgen_ignorable
Passed test_xmlgen_ns
Passed test_xmlgen_pi
2
4
tests, 0 failures
2
6
tests, 0 failures
Lib/test/test_sax.py
Dosyayı görüntüle @
80670bca
...
...
@@ -2,10 +2,11 @@
# regression test for SAX 2.0
# $Id$
from
xml.sax
import
make_parser
,
ContentHandler
from
xml.sax
import
make_parser
,
ContentHandler
,
\
SAXException
,
SAXReaderNotAvailable
,
SAXParseException
try
:
make_parser
()
except
xml
.
sax
.
SAXReaderNotAvailable
:
except
SAXReaderNotAvailable
:
# don't try to test this module if we cannot create a parser
raise
ImportError
(
"no XML parsers available"
)
from
xml.sax.saxutils
import
XMLGenerator
,
escape
,
XMLFilterBase
...
...
@@ -313,6 +314,36 @@ def test_expat_inpsource_stream():
return
result
.
getvalue
()
==
xml_test_out
# ===========================================================================
#
# error reporting
#
# ===========================================================================
def
test_expat_inpsource_location
():
parser
=
create_parser
()
parser
.
setContentHandler
(
ContentHandler
())
# do nothing
source
=
InputSource
()
source
.
setByteStream
(
StringIO
(
"<foo bar foobar>"
))
#ill-formed
name
=
"a file name"
source
.
setSystemId
(
name
)
try
:
parser
.
parse
(
source
)
except
SAXException
,
e
:
return
e
.
getSystemId
()
==
name
def
test_expat_incomplete
():
parser
=
create_parser
()
parser
.
setContentHandler
(
ContentHandler
())
# do nothing
try
:
parser
.
parse
(
StringIO
(
"<foo>"
))
except
SAXParseException
:
return
1
# ok, error found
else
:
return
0
# ===========================================================================
#
# xmlreader tests
...
...
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