~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_move.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-07-23 23:05:45 UTC
  • mfrom: (6039.1.3 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20110723230545-ui2ebmcs0i6a9dqc
(jelmer) Fix some tests to cope with working trees that do not support
 versioned directories. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
        tree._validate()
349
349
 
350
350
    def test_move_directory_into_parent(self):
 
351
        if not self.workingtree_format.supports_versioned_directories:
 
352
            raise tests.TestNotApplicable(
 
353
                "test requires versioned directories")
351
354
        tree = self.make_branch_and_tree('.')
352
355
        self.build_tree(['c/', 'c/b/', 'c/b/d/'])
353
356
        tree.add(['c', 'c/b', 'c/b/d'],
372
375
        tree.commit('initial', rev_id='rev-1')
373
376
        root_id = tree.get_root_id()
374
377
 
375
 
 
376
378
        tree.rename_one('a/b', 'a/c/b')
377
 
        self.assertTreeLayout([('', root_id),
378
 
                               ('a', 'a-id'),
379
 
                               ('d', 'd-id'),
380
 
                               ('a/c', 'c-id'),
381
 
                               ('a/c/b', 'b-id'),
382
 
                              ], tree)
 
379
        if self.workingtree_format.supports_versioned_directories:
 
380
            self.assertTreeLayout([('', root_id),
 
381
                                   ('a', 'a-id'),
 
382
                                   ('d', 'd-id'),
 
383
                                   ('a/c', 'c-id'),
 
384
                                   ('a/c/b', 'b-id'),
 
385
                                  ], tree)
 
386
        else:
 
387
            self.assertTreeLayout([('', root_id),
 
388
                                   ('a', 'a-id'),
 
389
                                   ('a/c', 'c-id'),
 
390
                                   ('a/c/b', 'b-id'),
 
391
                                  ], tree)
383
392
        self.assertEqual([('a', 'd/a')],
384
393
                         tree.move(['a'], 'd'))
385
394
        self.assertTreeLayout([('', root_id),