예제 #1
0
	def testExtract(self):
		"""
		Tests :meth:`foundations.pkzip.Pkzip.extract` method.
		"""

		zipFile = Pkzip(TEST_FILE)
		tempDirectory = tempfile.mkdtemp()
		extractionSuccess = zipFile.extract(tempDirectory)
		self.assertTrue(extractionSuccess)
		for item in TREE_HIERARCHY:
			self.assertTrue(os.path.exists(os.path.join(tempDirectory, item)))
		shutil.rmtree(tempDirectory)
예제 #2
0
    def testExtract(self):
        """
		This method tests :meth:`foundations.pkzip.Pkzip.extract` method.
		"""

        zipFile = Pkzip(TEST_FILE)
        tempDirectory = tempfile.mkdtemp()
        extractionSuccess = zipFile.extract(tempDirectory)
        self.assertTrue(extractionSuccess)
        for item in TREE_HIERARCHY:
            self.assertTrue(os.path.exists(os.path.join(tempDirectory, item)))
        shutil.rmtree(tempDirectory)
예제 #3
0
	def extractZipFile(self, file):
		"""
		This method uncompress the given zip file.

		:param file: File to extract. ( String )
		:return: Extraction success. ( Boolean )
		"""

		LOGGER.debug("> Initializing '{0}' file uncompress.".format(file))

		pkzip = Pkzip()
		pkzip.archive = file

		return pkzip.extract(os.path.dirname(file))
예제 #4
0
    def extractZipFile(self, file):
        """
		This method uncompress the given zip file.

		:param file: File to extract. ( String )
		:return: Extraction success. ( Boolean )
		"""

        LOGGER.debug("> Initializing '{0}' file uncompress.".format(file))

        pkzip = Pkzip()
        pkzip.archive = file

        return pkzip.extract(os.path.dirname(file))
예제 #5
0
    def extractZipFile(self, file):
        """
		Uncompress the given zip file.

		:param file: File to extract.
		:type file: unicode
		:return: Extraction success.
		:rtype: bool
		"""

        LOGGER.debug("> Initializing '{0}' file uncompress.".format(file))

        pkzip = Pkzip()
        pkzip.archive = file

        return pkzip.extract(os.path.dirname(file))
예제 #6
0
	def extractZipFile(self, file):
		"""
		Uncompress the given zip file.

		:param file: File to extract.
		:type file: unicode
		:return: Extraction success.
		:rtype: bool
		"""

		LOGGER.debug("> Initializing '{0}' file uncompress.".format(file))

		pkzip = Pkzip()
		pkzip.archive = file

		return pkzip.extract(os.path.dirname(file))