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
11328e44
Kaydet (Commit)
11328e44
authored
May 06, 2012
tarafından
Nadeem Vawda
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Really fix test_gzip failures on Windows.
üst
fe8440ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
test_gzip.py
Lib/test/test_gzip.py
+7
-5
No files found.
Lib/test/test_gzip.py
Dosyayı görüntüle @
11328e44
...
...
@@ -409,19 +409,20 @@ class TestOpen(BaseTest):
self
.
assertEqual
(
file_data
,
uncompressed
*
2
)
def
test_text_modes
(
self
):
uncompressed
=
data1
.
decode
(
"ascii"
)
.
replace
(
"
\n
"
,
os
.
linesep
)
*
50
uncompressed
=
data1
.
decode
(
"ascii"
)
*
50
uncompressed_raw
=
uncompressed
.
replace
(
"
\n
"
,
os
.
linesep
)
with
gzip
.
open
(
self
.
filename
,
"wt"
)
as
f
:
f
.
write
(
uncompressed
)
with
open
(
self
.
filename
,
"rb"
)
as
f
:
file_data
=
gzip
.
decompress
(
f
.
read
())
.
decode
(
"ascii"
)
self
.
assertEqual
(
file_data
,
uncompressed
)
self
.
assertEqual
(
file_data
,
uncompressed
_raw
)
with
gzip
.
open
(
self
.
filename
,
"rt"
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
uncompressed
)
with
gzip
.
open
(
self
.
filename
,
"at"
)
as
f
:
f
.
write
(
uncompressed
)
with
open
(
self
.
filename
,
"rb"
)
as
f
:
file_data
=
gzip
.
decompress
(
f
.
read
())
.
decode
(
"ascii"
)
self
.
assertEqual
(
file_data
,
uncompressed
*
2
)
self
.
assertEqual
(
file_data
,
uncompressed
_raw
*
2
)
def
test_bad_params
(
self
):
# Test invalid parameter combinations.
...
...
@@ -436,12 +437,13 @@ class TestOpen(BaseTest):
def
test_encoding
(
self
):
# Test non-default encoding.
uncompressed
=
data1
.
decode
(
"ascii"
)
.
replace
(
"
\n
"
,
os
.
linesep
)
*
50
uncompressed
=
data1
.
decode
(
"ascii"
)
*
50
uncompressed_raw
=
uncompressed
.
replace
(
"
\n
"
,
os
.
linesep
)
with
gzip
.
open
(
self
.
filename
,
"wt"
,
encoding
=
"utf-16"
)
as
f
:
f
.
write
(
uncompressed
)
with
open
(
self
.
filename
,
"rb"
)
as
f
:
file_data
=
gzip
.
decompress
(
f
.
read
())
.
decode
(
"utf-16"
)
self
.
assertEqual
(
file_data
,
uncompressed
)
self
.
assertEqual
(
file_data
,
uncompressed
_raw
)
with
gzip
.
open
(
self
.
filename
,
"rt"
,
encoding
=
"utf-16"
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
uncompressed
)
...
...
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