~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_controldir/test_controldir.py

  • Committer: Martin Pool
  • Date: 2011-04-15 07:01:22 UTC
  • mto: This revision was merged to the branch mainline in revision 5789.
  • Revision ID: mbp@sourcefrog.net-20110415070122-7x24skeadcm7wvut
Switch away from using failUnlessExists and failIfExists

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
            bzrdir.destroy_workingtree()
123
123
        except errors.UnsupportedOperation:
124
124
            raise TestSkipped('Format does not support destroying tree')
125
 
        self.failIfExists('tree/file')
 
125
        self.assertPathDoesNotExist('tree/file')
126
126
        self.assertRaises(errors.NoWorkingTree, bzrdir.open_workingtree)
127
127
        bzrdir.create_workingtree()
128
 
        self.failUnlessExists('tree/file')
 
128
        self.assertPathExists('tree/file')
129
129
        bzrdir.destroy_workingtree_metadata()
130
 
        self.failUnlessExists('tree/file')
 
130
        self.assertPathExists('tree/file')
131
131
        self.assertRaises(errors.NoWorkingTree, bzrdir.open_workingtree)
132
132
 
133
133
    def test_destroy_branch(self):
860
860
                create_tree_if_local=False)
861
861
        except errors.MustHaveWorkingTree:
862
862
            raise TestNotApplicable("control dir format requires working tree")
863
 
        self.failIfExists('target/foo')
 
863
        self.assertPathDoesNotExist('target/foo')
864
864
        self.assertEqual(tree.branch.last_revision(),
865
865
                         target.open_branch().last_revision())
866
866
 
1409
1409
        old_url, new_url = tree.bzrdir.backup_bzrdir()
1410
1410
        old_path = urlutils.local_path_from_url(old_url)
1411
1411
        new_path = urlutils.local_path_from_url(new_url)
1412
 
        self.failUnlessExists(old_path)
1413
 
        self.failUnlessExists(new_path)
 
1412
        self.assertPathExists(old_path)
 
1413
        self.assertPathExists(new_path)
1414
1414
        for (((dir_relpath1, _), entries1),
1415
1415
             ((dir_relpath2, _), entries2)) in izip(
1416
1416
                osutils.walkdirs(old_path),