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:
@@ -63,6 +63,25 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
# check for symbolic links
|
# check for symbolic links
|
||||||
testfile = targetDir + "/sandbox/deneme/hed"
|
testfile = targetDir + "/sandbox/deneme/hed"
|
||||||
assert islink(testfile)
|
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):
|
def testUnpackZipCond(self):
|
||||||
ctx = context.BuildContext("tests/sandbox/sandbox.pspec")
|
ctx = context.BuildContext("tests/sandbox/sandbox.pspec")
|
||||||
|
|||||||
Reference in New Issue
Block a user