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
b2984ab9
Unverified
Kaydet (Commit)
b2984ab9
authored
Eyl 19, 2018
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Eyl 19, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-25711: Remove outdated zipimport tests. (GH-9404)
They were specific to the C implementation.
üst
3705b986
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
49 deletions
+0
-49
test_zipimport.py
Lib/test/test_zipimport.py
+0
-49
No files found.
Lib/test/test_zipimport.py
Dosyayı görüntüle @
b2984ab9
...
@@ -539,28 +539,6 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
...
@@ -539,28 +539,6 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z
.
close
()
z
.
close
()
os
.
remove
(
TEMP_ZIP
)
os
.
remove
(
TEMP_ZIP
)
def
test_issue31291
(
self
):
# There shouldn't be an assertion failure in get_data().
class
FunnyStr
(
str
):
def
replace
(
self
,
old
,
new
):
return
42
z
=
ZipFile
(
TEMP_ZIP
,
"w"
)
try
:
name
=
"test31291.dat"
data
=
b
'foo'
z
.
writestr
(
name
,
data
)
z
.
close
()
zi
=
zipimport
.
zipimporter
(
TEMP_ZIP
)
try
:
data2
=
zi
.
get_data
(
FunnyStr
(
name
))
except
AttributeError
:
pass
else
:
self
.
assertEqual
(
data2
,
data
)
finally
:
z
.
close
()
os
.
remove
(
TEMP_ZIP
)
def
testImporterAttr
(
self
):
def
testImporterAttr
(
self
):
src
=
"""if 1: # indent hack
src
=
"""if 1: # indent hack
def get_file():
def get_file():
...
@@ -687,38 +665,11 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
...
@@ -687,38 +665,11 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
with
self
.
assertRaises
(
TypeError
):
with
self
.
assertRaises
(
TypeError
):
zipimport
.
zipimporter
(
memoryview
(
os
.
fsencode
(
filename
)))
zipimport
.
zipimporter
(
memoryview
(
os
.
fsencode
(
filename
)))
@support.cpython_only
def
testUninitializedZipimporter
(
self
):
# The interpreter shouldn't crash in case of calling methods of an
# uninitialized zipimport.zipimporter object.
zi
=
zipimport
.
zipimporter
.
__new__
(
zipimport
.
zipimporter
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
find_module
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
find_loader
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
load_module
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
get_filename
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
is_package
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
get_data
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
get_code
,
'foo'
)
self
.
assertRaises
((
ValueError
,
AttributeError
),
zi
.
get_source
,
'foo'
)
@support.requires_zlib
@support.requires_zlib
class
CompressedZipImportTestCase
(
UncompressedZipImportTestCase
):
class
CompressedZipImportTestCase
(
UncompressedZipImportTestCase
):
compression
=
ZIP_DEFLATED
compression
=
ZIP_DEFLATED
@support.cpython_only
def
test_issue31602
(
self
):
# There shouldn't be an assertion failure in zipimporter.get_source()
# in case of a bad zlib.decompress().
def
bad_decompress
(
*
args
):
return
None
with
ZipFile
(
TEMP_ZIP
,
'w'
)
as
zip_file
:
self
.
addCleanup
(
support
.
unlink
,
TEMP_ZIP
)
zip_file
.
writestr
(
'bar.py'
,
b
'print("hello world")'
,
ZIP_DEFLATED
)
zi
=
zipimport
.
zipimporter
(
TEMP_ZIP
)
with
support
.
swap_attr
(
zlib
,
'decompress'
,
bad_decompress
):
self
.
assertRaises
((
TypeError
,
AttributeError
),
zi
.
get_source
,
'bar'
)
class
BadFileZipImportTestCase
(
unittest
.
TestCase
):
class
BadFileZipImportTestCase
(
unittest
.
TestCase
):
def
assertZipFailure
(
self
,
filename
):
def
assertZipFailure
(
self
,
filename
):
...
...
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