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)
1
Konular (issue)
1
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
c93b54e7
Kaydet (Commit)
c93b54e7
authored
Ara 08, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* fix archivetests
üst
d19d8d3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
autoxml.py
pisi/pxml/autoxml.py
+4
-1
archivetests.py
tests/archivetests.py
+21
-20
No files found.
pisi/pxml/autoxml.py
Dosyayı görüntüle @
c93b54e7
...
...
@@ -297,7 +297,8 @@ class autoxml(oo.autosuper, oo.autoprop):
# generate top-level helper functions
cls
.
initializers
=
inits
def
initialize
(
self
,
**
args
):
def
initialize
(
self
,
uri
=
None
,
keepDoc
=
False
,
tmpDir
=
'/tmp'
,
**
args
):
if
xmlfile_support
:
# totally dailywtf
#if args.has_key('tag'):
...
...
@@ -317,6 +318,8 @@ class autoxml(oo.autosuper, oo.autoprop):
# init hook
if
hasattr
(
self
,
'init'
):
self
.
init
(
tag
)
if
uri
:
self
.
read
(
uri
,
keepDoc
,
tmpDir
)
cls
.
__init__
=
initialize
...
...
tests/archivetests.py
Dosyayı görüntüle @
c93b54e7
...
...
@@ -19,7 +19,8 @@ from pisi import archive
from
pisi
import
sourcearchive
from
pisi
import
fetcher
from
pisi
import
util
from
pisi.build
import
BuildContext
#from pisi.build import BuildContext
from
pisi.specfile
import
SpecFile
from
pisi
import
uri
import
testcase
...
...
@@ -27,11 +28,11 @@ import testcase
class
ArchiveFileTestCase
(
testcase
.
TestCase
):
def
testUnpackTar
(
self
):
bctx
=
BuildContext
(
"tests/popt/pspec.xml"
)
achv
=
sourcearchive
.
SourceArchive
(
bctx
)
spec
=
SpecFile
(
"tests/popt/pspec.xml"
)
targetDir
=
'/tmp/pisitest'
achv
=
sourcearchive
.
SourceArchive
(
spec
,
targetDir
)
assert
bctx
.
spec
.
source
.
archive
.
type
==
"targz"
assert
spec
.
source
.
archive
.
type
==
"targz"
# skip fetching and directly unpack the previously fetched (by
# fetchertests) archive
...
...
@@ -39,7 +40,6 @@ class ArchiveFileTestCase(testcase.TestCase):
achv
.
fetch
(
interactive
=
False
)
achv
.
unpack
()
targetDir
=
bctx
.
pkg_work_dir
()
# but testing is hard
# "var/tmp/pisi/popt-1.7-3/work" (targetDir)
assert
pathexists
(
targetDir
+
"/popt-1.7"
)
...
...
@@ -52,15 +52,15 @@ class ArchiveFileTestCase(testcase.TestCase):
"5af9dd7d754f788cf511c57ce0af3d555fed009d"
)
def
testUnpackZip
(
self
):
bctx
=
BuildContext
(
"tests/pccts/pspec.xml"
)
spec
=
SpecFile
(
"tests/pccts/pspec.xml"
)
targetDir
=
'/tmp/pisitest'
assert
bctx
.
spec
.
source
.
archive
.
type
==
"zip"
assert
spec
.
source
.
archive
.
type
==
"zip"
achv
=
sourcearchive
.
SourceArchive
(
bctx
)
achv
=
sourcearchive
.
SourceArchive
(
spec
,
targetDir
)
achv
.
fetch
(
interactive
=
False
)
achv
.
unpack
(
clean_dir
=
True
)
targetDir
=
bctx
.
pkg_work_dir
()
assert
pathexists
(
targetDir
+
"/pccts"
)
testfile
=
targetDir
+
"/pccts/history.txt"
...
...
@@ -78,9 +78,9 @@ class ArchiveFileTestCase(testcase.TestCase):
def
testMakeZip
(
self
):
# first unpack our dear sandbox.zip
bctx
=
BuildContext
(
"tests/pccts/pspec.xml"
)
targetDir
=
bctx
.
pkg_work_dir
()
achv
=
sourcearchive
.
SourceArchive
(
bctx
)
spec
=
SpecFile
(
"tests/pccts/pspec.xml"
)
targetDir
=
'/tmp/pisitest'
achv
=
sourcearchive
.
SourceArchive
(
spec
,
targetDir
)
achv
.
fetch
(
interactive
=
False
)
achv
.
unpack
(
clean_dir
=
True
)
del
achv
...
...
@@ -94,18 +94,19 @@ class ArchiveFileTestCase(testcase.TestCase):
#TODO: do some more work to test the integrity of new zip file
def
testUnpackZipCond
(
self
):
bctx
=
BuildContext
(
"tests/pccts/pspec.xml"
)
url
=
uri
.
URI
(
bctx
.
spec
.
source
.
archive
.
uri
)
targetDir
=
bctx
.
pkg_work_dir
()
spec
=
SpecFile
(
"tests/pccts/pspec.xml"
)
targetDir
=
'/tmp'
achv
=
sourcearchive
.
SourceArchive
(
spec
,
targetDir
)
url
=
uri
.
URI
(
spec
.
source
.
archive
.
uri
)
filePath
=
join
(
ctx
.
config
.
archives_dir
(),
url
.
filename
())
# check cached
if
util
.
sha1_file
(
filePath
)
!=
bctx
.
spec
.
source
.
archive
.
sha1sum
:
fetch
=
fetcher
.
Fetcher
(
bctx
.
spec
.
source
.
archive
.
uri
,
targetDir
)
if
util
.
sha1_file
(
filePath
)
!=
spec
.
source
.
archive
.
sha1sum
:
fetch
=
fetcher
.
Fetcher
(
spec
.
source
.
archive
.
uri
,
targetDir
)
fetch
.
fetch
()
assert
bctx
.
spec
.
source
.
archive
.
type
==
"zip"
assert
spec
.
source
.
archive
.
type
==
"zip"
achv
=
archive
.
Archive
(
filePath
,
bctx
.
spec
.
source
.
archive
.
type
)
achv
=
archive
.
Archive
(
filePath
,
spec
.
source
.
archive
.
type
)
achv
.
unpack_files
([
"pccts/history.txt"
],
targetDir
)
assert
pathexists
(
targetDir
+
"/pccts"
)
testfile
=
targetDir
+
"/pccts/history.txt"
...
...
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