From 6a270f02e08d3519979876651145db2d44c35fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Wed, 15 Jun 2005 08:45:49 +0000 Subject: [PATCH] =?UTF-8?q?ar=C5=9Fiv=20testleri=20art=C4=B1k=20(olmas?= =?UTF-8?q?=C4=B1=20gerekti=C4=9Fi=20gibi)=20daha=20kat=C4=B1.=20Testler?= =?UTF-8?q?=20=C5=9Fu=20anda=20"fail"=20ediyor.=20archive.py=20sevgi=20bek?= =?UTF-8?q?liyor=20haliyle=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/unittests/archivetests.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/unittests/archivetests.py b/src/unittests/archivetests.py index d077e53f..69f76885 100644 --- a/src/unittests/archivetests.py +++ b/src/unittests/archivetests.py @@ -1,7 +1,7 @@ import unittest from os.path import exists as pathexists -from os.path import basename +from os.path import basename, islink from pisi import archive from pisi import specfile @@ -28,11 +28,13 @@ class ArchiveFileTestCase(unittest.TestCase): achv.unpack() # but testing is hard - assert pathexists("popt-1.7") + # "var/tmp/pisi/popt-1.7-3/work" (targetDir) + assert pathexists(targetDir + "/popt-1.7") - testfile = "popt-1.7/Makefile.am" + testfile = targetDir + "/popt-1.7/Makefile.am" assert pathexists(testfile) + # check file integrity self.assertEqual(util.md5_file(testfile), "171545adab7b51ebf6ec5575d3000a95") @@ -48,7 +50,20 @@ class ArchiveFileTestCase(unittest.TestCase): achv = archive.Archive("zip", filename, targetDir) achv.unpack() + + assert pathexists(targetDir + "/sandbox") + + testfile = targetDir + "/sandbox/borek.cs" + assert pathexists(testfile) + + # check file integrity + self.assertEqual(util.md5_file(testfile), + "1e0c3f1e4664ee8ca67caea8b6b12ea4") + + # check for symbolic links + testfile = targetDir + "/sandbox/deneme/hed" + assert islink(testfile) + suite = unittest.makeSuite(ArchiveFileTestCase) -