From 85819adf1f9899e57b04bc10545884ed0c0af39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 24 Jun 2005 11:49:02 +0000 Subject: [PATCH] =?UTF-8?q?zip=20yapmak=20i=C3=A7in=20yeni=20test.=20Bu=20?= =?UTF-8?q?sayedi=20bir=20hatam=C4=B1z=C4=B1=20ke=C5=9Ffettik.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ArchiveZip:add_to_archive()'e real path verildiği zaman çakılıyoruz. archive.py'yi güncelleyeceğiz... --- tests/archivetests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/archivetests.py b/tests/archivetests.py index 135a7c5c..d3d65ed7 100644 --- a/tests/archivetests.py +++ b/tests/archivetests.py @@ -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")