~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

  • Committer: Jelmer Vernooij
  • Date: 2009-04-15 11:13:59 UTC
  • mto: This revision was merged to the branch mainline in revision 4293.
  • Revision ID: jelmer@samba.org-20090415111359-td8oouuqs7mc9knk
Remove unused functions for updating the file ids of a tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
309
309
 
310
310
 
311
311
class WorkingTreeFileUpdateTests(TestCaseWithTransport):
312
 
    """Tests for _determine_fileid_renames()."""
313
 
 
314
 
    def test_det_renames_same(self):
315
 
        a = Inventory()
316
 
        a.add_path("bla", "directory", "bla-a")
317
 
        b = Inventory()
318
 
        b.add_path("bla", "directory", "bla-a")
319
 
        self.assertEquals({
320
 
            '': ('TREE_ROOT', 'TREE_ROOT'), 
321
 
            'bla': ('bla-a', 'bla-a')},
322
 
            foreign._determine_fileid_renames(a, b))
323
 
 
324
 
    def test_det_renames_simple(self):
325
 
        a = Inventory()
326
 
        a.add_path("bla", "directory", "bla-a")
327
 
        b = Inventory()
328
 
        b.add_path("bla", "directory", "bla-b")
329
 
        self.assertEquals({
330
 
            '': ('TREE_ROOT', 'TREE_ROOT'), 
331
 
            'bla': ('bla-a', 'bla-b'),
332
 
            }, foreign._determine_fileid_renames(a, b))
333
 
 
334
 
    def test_det_renames_root(self):
335
 
        a = Inventory()
336
 
        a.add_path("", "directory", "bla-a")
337
 
        b = Inventory()
338
 
        b.add_path("", "directory", "bla-b")
339
 
        self.assertEquals(
340
 
                {"": ("bla-a", "bla-b")},
341
 
                foreign._determine_fileid_renames(a, b))
342
 
 
343
 
    def test_update_workinginv(self):
344
 
        a = Inventory()
345
 
        a.add_path("bla", "directory", "bla-a")
346
 
        b = Inventory()
347
 
        b.add_path("bla", "directory", "bla-b")
348
 
        wt = self.make_branch_and_tree('br1')
349
 
        self.build_tree_contents([('br1/bla', 'original contents\n')])
350
 
        wt.add('bla', 'bla-a')
351
 
        foreign.update_workinginv_fileids(wt, a, b)
352
 
        wt.lock_read()
353
 
        try:
354
 
            self.assertEquals(["TREE_ROOT", "bla-b"], list(wt.inventory))
355
 
        finally:
356
 
            wt.unlock()
 
312
    """Tests for update_workingtree_fileids()."""
357
313
 
358
314
    def test_update_workingtree(self):
359
315
        wt = self.make_branch_and_tree('br1')