~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Lib/test/test_zipfile.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
507
507
        except zipfile.BadZipFile:
508
508
            self.assertTrue(zipfp2.fp is None, 'zipfp is not closed')
509
509
 
 
510
    def test_add_file_before_1980(self):
 
511
        # Set atime and mtime to 1970-01-01
 
512
        os.utime(TESTFN, (0, 0))
 
513
        with zipfile.ZipFile(TESTFN2, "w") as zipfp:
 
514
            self.assertRaises(ValueError, zipfp.write, TESTFN)
 
515
 
 
516
 
510
517
    @skipUnless(zlib, "requires zlib")
511
518
    def test_unicode_filenames(self):
512
519
        # bug #10801
1053
1060
        f.close()
1054
1061
        self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, TESTFN, 'r')
1055
1062
 
 
1063
    def test_create_zipinfo_before_1980(self):
 
1064
        self.assertRaises(ValueError,
 
1065
                          zipfile.ZipInfo, 'seventies', (1979, 1, 1, 0, 0, 0))
 
1066
 
1056
1067
    def tearDown(self):
1057
1068
        unlink(TESTFN)
1058
1069
        unlink(TESTFN2)