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
23298cb7
Kaydet (Commit)
23298cb7
authored
Şub 02, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix tests for issue #11159.
üst
07fbf60c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
test_sax.py
Lib/test/test_sax.py
+16
-6
No files found.
Lib/test/test_sax.py
Dosyayı görüntüle @
23298cb7
...
...
@@ -14,6 +14,7 @@ from xml.sax.expatreader import create_parser
from
xml.sax.handler
import
feature_namespaces
from
xml.sax.xmlreader
import
InputSource
,
AttributesImpl
,
AttributesNSImpl
from
cStringIO
import
StringIO
import
os.path
import
shutil
import
test.test_support
as
support
from
test.test_support
import
findfile
,
run_unittest
...
...
@@ -22,6 +23,18 @@ import unittest
TEST_XMLFILE
=
findfile
(
"test.xml"
,
subdir
=
"xmltestdata"
)
TEST_XMLFILE_OUT
=
findfile
(
"test.xml.out"
,
subdir
=
"xmltestdata"
)
supports_unicode_filenames
=
True
if
not
os
.
path
.
supports_unicode_filenames
:
try
:
support
.
TESTFN_UNICODE
.
encode
(
support
.
TESTFN_ENCODING
)
except
(
AttributeError
,
UnicodeError
,
TypeError
):
# Either the file system encoding is None, or the file name
# cannot be encoded in the file system encoding.
supports_unicode_filenames
=
False
requires_unicode_filenames
=
unittest
.
skipUnless
(
supports_unicode_filenames
,
'Requires unicode filenames support'
)
ns_uri
=
"http://www.python.org/xml-ns/saxtest/"
class
XmlTestBase
(
unittest
.
TestCase
):
...
...
@@ -386,8 +399,7 @@ class ExpatReaderTest(XmlTestBase):
self
.
assertEqual
(
result
.
getvalue
(),
xml_test_out
)
@unittest.skipUnless
(
hasattr
(
support
,
'TESTFN_UNICODE'
),
'Requires unicode filenames support'
)
@requires_unicode_filenames
def
test_expat_file_unicode
(
self
):
fname
=
support
.
TESTFN_UNICODE
shutil
.
copyfile
(
TEST_XMLFILE
,
fname
)
...
...
@@ -541,8 +553,7 @@ class ExpatReaderTest(XmlTestBase):
self
.
assertEqual
(
result
.
getvalue
(),
xml_test_out
)
@unittest.skipUnless
(
hasattr
(
support
,
'TESTFN_UNICODE'
),
'Requires unicode filenames support'
)
@requires_unicode_filenames
def
test_expat_inpsource_sysid_unicode
(
self
):
fname
=
support
.
TESTFN_UNICODE
shutil
.
copyfile
(
TEST_XMLFILE
,
fname
)
...
...
@@ -630,8 +641,7 @@ class ExpatReaderTest(XmlTestBase):
self
.
assertEqual
(
parser
.
getSystemId
(),
TEST_XMLFILE
)
self
.
assertEqual
(
parser
.
getPublicId
(),
None
)
@unittest.skipUnless
(
hasattr
(
support
,
'TESTFN_UNICODE'
),
'Requires unicode filenames support'
)
@requires_unicode_filenames
def
test_expat_locator_withinfo_unicode
(
self
):
fname
=
support
.
TESTFN_UNICODE
shutil
.
copyfile
(
TEST_XMLFILE
,
fname
)
...
...
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