示例#1
0
    def test_zipArchiveRepr(self):
        """
        Make sure that invoking ZipArchive's repr prints the correct class
        name and an absolute path to the zip file.
        """
        pathRepr = 'ZipArchive(%r)' % (os.path.abspath(self.cmn + '.zip'),)

        # Check for an absolute path
        self.assertEqual(repr(self.path), pathRepr)

        # Create a path to the file rooted in the current working directory
        relativeCommon = self.cmn.replace(os.getcwd() + os.sep, "", 1) + ".zip"
        relpath = ZipArchive(relativeCommon)

        # Check using a path without the cwd prepended
        self.assertEqual(repr(relpath), pathRepr)
示例#2
0
 def setUp(self):
     AbstractFilePathTestCase.setUp(self)
     zipit(self.cmn, self.cmn + '.zip')
     self.path = ZipArchive(self.cmn + '.zip')
     self.root = self.path
     self.all = [x.replace(self.cmn, self.cmn + '.zip') for x in self.all]