~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Aaron Bentley
  • Date: 2009-08-21 18:07:25 UTC
  • mto: This revision was merged to the branch mainline in revision 4718.
  • Revision ID: aaron@aaronbentley.com-20090821180725-n9voqqtwq6zzwhbx
Fix OSError with renamed files in PreviewTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2274
2274
        self.assertEqual(os.stat(limbo_path).st_mtime,
2275
2275
                         preview_tree.get_file_mtime('file-id'))
2276
2276
 
 
2277
    def test_get_file_mtime_renamed(self):
 
2278
        work_tree = self.make_branch_and_tree('tree')
 
2279
        self.build_tree(['tree/file'])
 
2280
        work_tree.add('file', 'file-id')
 
2281
        preview = TransformPreview(work_tree)
 
2282
        self.addCleanup(preview.finalize)
 
2283
        file_trans_id = preview.trans_id_tree_file_id('file-id')
 
2284
        preview.adjust_path('renamed', preview.root, file_trans_id)
 
2285
        preview_tree = preview.get_preview_tree()
 
2286
        preview_mtime = preview_tree.get_file_mtime('file-id', 'renamed')
 
2287
        work_mtime = work_tree.get_file_mtime('file-id', 'file')
 
2288
 
2277
2289
    def test_get_file(self):
2278
2290
        preview = self.get_empty_preview()
2279
2291
        preview.new_file('file', preview.root, 'contents', 'file-id')