~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_export.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-13 21:30:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5724.
  • Revision ID: jelmer@samba.org-20110313213033-ud9t11mm8e3idtti
Add test for per-file-timestamp zipfiles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import tarfile
22
22
import time
 
23
import zipfile
23
24
 
24
25
from bzrlib import (
25
26
    errors,
191
192
            wt.unlock()
192
193
        self.assertEquals(["bar/a"], ball.getnames())
193
194
        ball.close()
 
195
 
 
196
 
 
197
class ZipExporterTests(tests.TestCaseWithTransport):
 
198
 
 
199
    def test_per_file_timestamps(self):
 
200
        tree = self.make_branch_and_tree('.')
 
201
        self.build_tree_contents([('har', 'foo')])
 
202
        tree.add('har')
 
203
        # Earliest allowable date on FAT32 filesystems is 1980-01-01
 
204
        tree.commit('setup', timestamp=315532800)
 
205
        export.export(tree.basis_tree(), 'test.zip', format='zip',
 
206
            per_file_timestamps=True)
 
207
        zfile = zipfile.ZipFile('test.zip')
 
208
        info = zfile.getinfo("test/har")
 
209
        self.assertEquals((1980, 1, 1, 1, 0, 0), info.date_time)