Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
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ç
SulinOS
inary
Commits
3235369f
Kaydet (Commit)
3235369f
authored
Haz 06, 2006
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* not needed here
üst
26f00ce2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
54 deletions
+0
-54
zipfileexttests.py
tests/zipfileexttests.py
+0
-54
No files found.
tests/zipfileexttests.py
deleted
100644 → 0
Dosyayı görüntüle @
26f00ce2
# Copyright (C) 2005, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
# Author: Eray Ozkural <eray at pardus.org.tr>
import
unittest
import
os
import
random
import
array
from
pisi.zipfileext
import
*
import
testcase
def
listtostr
(
list
):
return
array
.
array
(
'B'
,
list
)
.
tostring
()
class
ZipFileExtCase
(
testcase
.
TestCase
):
def
setUp
(
self
):
testcase
.
TestCase
.
setUp
(
self
,
database
=
False
)
def
makeRandomFile
(
self
,
fn
):
random
.
seed
()
str
=
listtostr
(
[
random
.
randint
(
0
,
255
)
for
x
in
range
(
18888
)
]
)
f
=
file
(
fn
,
'w'
)
f
.
write
(
str
)
return
str
def
genericTestZipUnzip
(
self
,
compress_type
):
str
=
self
.
makeRandomFile
(
'tmp/random'
)
zipfile
=
ZipFileExt
(
'tmp/test.zip'
,
'w'
)
zipfile
.
write
(
'tmp/random'
,
compress_type
=
compress_type
)
zipfile
.
close
()
zipfile2
=
ZipFileExt
(
'tmp/test.zip'
,
'r'
)
str2
=
zipfile2
.
read
(
'tmp/random'
)
self
.
assertEqual
(
str
,
str2
)
def
testStoredZipUnzip
(
self
):
self
.
genericTestZipUnzip
(
ZIP_STORED
)
def
testDeflateZipUnzip
(
self
):
self
.
genericTestZipUnzip
(
ZIP_DEFLATED
)
def
testLzmaZipUnzip
(
self
):
self
.
genericTestZipUnzip
(
ZIP_LZMA_BOGUS
)
suite
=
unittest
.
makeSuite
(
ZipFileExtCase
)
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