* test code'unu duzelt, file yerine files de unpack interface'ine. kabak gibi cikti simdi hatalar tabii
This commit is contained in:
+5
-5
@@ -84,11 +84,11 @@ class ArchiveZip(ArchiveBase):
|
|||||||
buff.close()
|
buff.close()
|
||||||
zip.close()
|
zip.close()
|
||||||
|
|
||||||
def unpack_file(self, path, targetDir):
|
def unpack_files(self, paths, targetDir):
|
||||||
unpack_file(self, lambda f:f==path, targetDir)
|
self.unpack_file_cond(self, lambda f:f in paths, targetDir)
|
||||||
|
|
||||||
def unpack_dir(self, path, 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):
|
def unpack(self, targetDir):
|
||||||
super(ArchiveZip, self).unpack(targetDir)
|
super(ArchiveZip, self).unpack(targetDir)
|
||||||
@@ -140,5 +140,5 @@ class Archive:
|
|||||||
def unpack(self, targetDir):
|
def unpack(self, targetDir):
|
||||||
self.archive.unpack(targetDir)
|
self.archive.unpack(targetDir)
|
||||||
|
|
||||||
def unpack_file(self, targetDir):
|
def unpack_files(self, files, targetDir):
|
||||||
self.archive.unpack(targetDir)
|
self.archive.unpack_files(files, targetDir)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
fileName = os.path.basename(ctx.spec.source.archiveUri)
|
fileName = os.path.basename(ctx.spec.source.archiveUri)
|
||||||
filePath = ctx.archives_dir() + '/' + fileName
|
filePath = ctx.archives_dir() + '/' + fileName
|
||||||
achv = archive.Archive(filePath, ctx.spec.source.archiveType)
|
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")
|
assert pathexists(targetDir + "/sandbox")
|
||||||
testfile = targetDir + "/sandbox/borek.cs"
|
testfile = targetDir + "/sandbox/borek.cs"
|
||||||
assert pathexists(testfile)
|
assert pathexists(testfile)
|
||||||
|
|||||||
Reference in New Issue
Block a user