~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_export.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib import (
21
21
    errors,
22
22
    export,
 
23
    osutils,
23
24
    tests,
24
25
    )
25
26
 
98
99
        st_b = t.stat('b')
99
100
        # All files must be given the same mtime.
100
101
        self.assertEqual(st_a.st_mtime, st_b.st_mtime)
101
 
 
102
 
    def test_dir_export_files_per_file_timestamps(self):
103
 
        builder = self.make_branch_builder('source')
104
 
        builder.start_series()
105
 
        # Earliest allowable date on FAT32 filesystems is 1980-01-01
106
 
        a_time = time.mktime((1999, 12, 12, 0, 0, 0, 0, 0, 0))
107
 
        b_time = time.mktime((1980, 01, 01, 0, 0, 0, 0, 0, 0))
108
 
        builder.build_snapshot(None, None, [
109
 
            ('add', ('', 'root-id', 'directory', '')),
110
 
            ('add', ('a', 'a-id', 'file', 'content\n'))],
111
 
            timestamp=a_time)
112
 
        builder.build_snapshot(None, None, [
113
 
            ('add', ('b', 'b-id', 'file', 'content\n'))],
114
 
            timestamp=b_time)
115
 
        builder.finish_series()
116
 
        b = builder.get_branch()
117
 
        b.lock_read()
118
 
        self.addCleanup(b.unlock)
119
 
        tree = b.basis_tree()
120
 
        export.export(tree, 'target', format='dir', per_file_timestamps=True)
121
 
        t = self.get_transport('target')
122
 
        self.assertEqual(a_time, t.stat('a').st_mtime)
123
 
        self.assertEqual(b_time, t.stat('b').st_mtime)