* test code'unu duzelt, file yerine files de unpack interface'ine. kabak gibi cikti simdi hatalar tabii

This commit is contained in:
Eray Özkural
2005-06-21 09:54:40 +00:00
parent 75ddadc2e3
commit e1cca01c2d
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -84,11 +84,11 @@ class ArchiveZip(ArchiveBase):
buff.close()
zip.close()
def unpack_file(self, path, targetDir):
unpack_file(self, lambda f:f==path, targetDir)
def unpack_files(self, paths, targetDir):
self.unpack_file_cond(self, lambda f:f in paths, targetDir)
def unpack_dir(self, path, targetDir):
unpack_file(self, lambda f:util.subpath(path,f), targetDir)
self.unpack_file_cond(self, lambda f:util.subpath(path,f), targetDir)
def unpack(self, targetDir):
super(ArchiveZip, self).unpack(targetDir)
@@ -140,5 +140,5 @@ class Archive:
def unpack(self, targetDir):
self.archive.unpack(targetDir)
def unpack_file(self, targetDir):
self.archive.unpack(targetDir)
def unpack_files(self, files, targetDir):
self.archive.unpack_files(files, targetDir)
+1 -1
View File
@@ -73,7 +73,7 @@ class ArchiveFileTestCase(unittest.TestCase):
fileName = os.path.basename(ctx.spec.source.archiveUri)
filePath = ctx.archives_dir() + '/' + fileName
achv = archive.Archive(filePath, ctx.spec.source.archiveType)
achv.unpack_file("sandbox/borek.cd")
achv.unpack_files(["sandbox/borek.cd"], targetDir)
assert pathexists(targetDir + "/sandbox")
testfile = targetDir + "/sandbox/borek.cs"
assert pathexists(testfile)