zip yapmak için yeni test.

Bu sayedi bir hatamızı keşfettik.

ArchiveZip:add_to_archive()'e real path verildiği zaman çakılıyoruz.

archive.py'yi güncelleyeceğiz...
This commit is contained in:
Barış Metin
2005-06-24 11:49:02 +00:00
parent 3cc597156a
commit 85819adf1f
+19
View File
@@ -63,6 +63,25 @@ class ArchiveFileTestCase(unittest.TestCase):
# check for symbolic links
testfile = targetDir + "/sandbox/deneme/hed"
assert islink(testfile)
def testMakeZip(self):
# first unpack our dear sandbox.zip
ctx = context.BuildContext("tests/sandbox/sandbox.pspec")
targetDir = ctx.pkg_work_dir()
fileName = os.path.basename(ctx.spec.source.archiveUri)
filePath = ctx.archives_dir() + '/' + fileName
achv = archive.Archive(filePath, ctx.spec.source.archiveType)
achv.unpack(targetDir)
del achv
newZip = targetDir + "/new.zip"
zip = archive.ArchiveZip(newZip, 'zip', 'w')
sourceDir = targetDir + "/sandbox"
zip.add_to_archive(sourceDir)
zip.close()
#TODO: do some more work to test the integrity of new zip file
def testUnpackZipCond(self):
ctx = context.BuildContext("tests/sandbox/sandbox.pspec")