~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_export.py

  • Committer: Aaron Bentley
  • Date: 2010-05-10 11:34:20 UTC
  • mfrom: (5218 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5221.
  • Revision ID: aaron@aaronbentley.com-20100510113420-toh2d5yioobb5uq1
Merged bzr.dev into transform-commit-full.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
    def test_dir_export_files_per_file_timestamps(self):
103
103
        builder = self.make_branch_builder('source')
104
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))
105
108
        builder.build_snapshot(None, None, [
106
109
            ('add', ('', 'root-id', 'directory', '')),
107
110
            ('add', ('a', 'a-id', 'file', 'content\n'))],
108
 
            timestamp=3423)
 
111
            timestamp=a_time)
109
112
        builder.build_snapshot(None, None, [
110
113
            ('add', ('b', 'b-id', 'file', 'content\n'))],
111
 
            timestamp=42)
 
114
            timestamp=b_time)
112
115
        builder.finish_series()
113
116
        b = builder.get_branch()
114
117
        b.lock_read()
116
119
        tree = b.basis_tree()
117
120
        export.export(tree, 'target', format='dir', per_file_timestamps=True)
118
121
        t = self.get_transport('target')
119
 
        st_a = t.stat('a')
120
 
        st_b = t.stat('b')
121
 
        self.assertEqual(42.0, st_b.st_mtime)
122
 
        self.assertEqual(3423.0, st_a.st_mtime)
 
122
        self.assertEqual(a_time, t.stat('a').st_mtime)
 
123
        self.assertEqual(b_time, t.stat('b').st_mtime)