~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Lib/test/test_tarfile.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
    def test_extractall(self):
256
256
        # Test if extractall() correctly restores directory permissions
257
257
        # and times (see issue1735).
258
 
        if sys.platform == "win32":
259
 
            # Win32 has no support for utime() on directories or
260
 
            # fine grained permissions.
261
 
            return
262
 
 
263
258
        tar = tarfile.open(tarname, encoding="iso8859-1")
264
259
        directories = [t for t in tar if t.isdir()]
265
260
        tar.extractall(TEMPDIR, directories)
266
261
        for tarinfo in directories:
267
262
            path = os.path.join(TEMPDIR, tarinfo.name)
268
 
            self.assertEqual(tarinfo.mode & 0o777, os.stat(path).st_mode & 0o777)
 
263
            if sys.platform != "win32":
 
264
                # Win32 has no support for fine grained permissions.
 
265
                self.assertEqual(tarinfo.mode & 0o777, os.stat(path).st_mode & 0o777)
269
266
            self.assertEqual(tarinfo.mtime, os.path.getmtime(path))
270
267
        tar.close()
271
268