/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_export.py

  • Committer: Robert Collins
  • Date: 2010-04-09 03:58:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5146.
  • Revision ID: robertc@robertcollins.net-20100409035814-eqayfeknoncyoctr
``bzrlib.commands.Command.run_direct`` is no longer needed - the pre
2.1 method of calling run() to perform testing or direct use via the API
is now possible again. As part of this, the _operation attribute on
Command is now transient and only exists for the duration of ``run()``.
(Robert Collins)

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))
108
105
        builder.build_snapshot(None, None, [
109
106
            ('add', ('', 'root-id', 'directory', '')),
110
107
            ('add', ('a', 'a-id', 'file', 'content\n'))],
111
 
            timestamp=a_time)
 
108
            timestamp=3423)
112
109
        builder.build_snapshot(None, None, [
113
110
            ('add', ('b', 'b-id', 'file', 'content\n'))],
114
 
            timestamp=b_time)
 
111
            timestamp=42)
115
112
        builder.finish_series()
116
113
        b = builder.get_branch()
117
114
        b.lock_read()
119
116
        tree = b.basis_tree()
120
117
        export.export(tree, 'target', format='dir', per_file_timestamps=True)
121
118
        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)
 
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)