~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_remove_tree.py

  • Committer: Vincent Ladeuil
  • Date: 2007-06-26 20:32:49 UTC
  • mto: (2581.1.1 cleanup-runbzr)
  • mto: This revision was merged to the branch mainline in revision 2588.
  • Revision ID: v.ladeuil+lp@free.fr-20070626203249-sqm4afiai5dxofum
Deprecate the varargs syntax and fix the tests.

* bzrlib/tests/__init__.py:
(TestCase.run_bzr): Activate the deprecation warning.
(TestCase.run_bzr_error): Add error_regexes to kwargs or run_bzr
get confused.

* bzrlib/tests/blackbox/test_selftest.py:
(TestRunBzr.test_args): Activate.

* bzrlib/tests/blackbox/test_inventory.py:
(TestInventory.assertInventoryEqual): Build the command from args
if not None.

* bzrlib/tests/blackbox/test_ls.py:
(TestLS.ls_equals): Build the command from args if not None.

* bzrlib/tests/blackbox/test_remove_tree.py:
(TestRemoveTree.test_remove_tree_lightweight_checkout_explicit):
Nice catch, we were calling run_bzr instead of run_bzr_error. This
went unnoticed for some time...

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        self.failIfExists('foo')
41
41
    
42
42
    def test_remove_tree_original_branch_explicit(self):
43
 
        self.run_bzr('remove-tree', 'branch1')
 
43
        self.run_bzr('remove-tree branch1')
44
44
        self.failIfExists('branch1/foo')
45
45
 
46
46
    def test_remove_tree_sprouted_branch(self):
53
53
    def test_remove_tree_sprouted_branch_explicit(self):
54
54
        self.tree.bzrdir.sprout('branch2')
55
55
        self.failUnlessExists('branch2/foo')
56
 
        self.run_bzr('remove-tree', 'branch2')
 
56
        self.run_bzr('remove-tree branch2')
57
57
        self.failIfExists('branch2/foo')
58
58
 
59
59
    def test_remove_tree_checkout(self):
68
68
    def test_remove_tree_checkout_explicit(self):
69
69
        self.tree.branch.create_checkout('branch2', lightweight=False)
70
70
        self.failUnlessExists('branch2/foo')
71
 
        self.run_bzr('remove-tree', 'branch2')
 
71
        self.run_bzr('remove-tree branch2')
72
72
        self.failIfExists('branch2/foo')
73
73
        self.failUnlessExists('branch1/foo')
74
74
 
88
88
    def test_remove_tree_lightweight_checkout_explicit(self):
89
89
        self.tree.branch.create_checkout('branch2', lightweight=True)
90
90
        self.failUnlessExists('branch2/foo')
91
 
        output = self.run_bzr(
92
 
            ["Cannot remove working tree from lightweight checkout"],
93
 
            'remove-tree', 'branch2', retcode=3)
 
91
        output = self.run_bzr_error(
 
92
            ["You cannot remove the working tree from a lightweight checkout"],
 
93
            'remove-tree branch2', retcode=3)
94
94
        self.failUnlessExists('branch2/foo')
95
95
        self.failUnlessExists('branch1/foo')
96
96
 
97
97
    def test_remove_tree_empty_dir(self):
98
98
        os.mkdir('branch2')
99
99
        os.chdir('branch2')
100
 
        output = self.run_bzr(["Not a branch"],
101
 
                              'remove-tree', retcode=3)
 
100
        output = self.run_bzr_error(["Not a branch"],
 
101
                                    'remove-tree', retcode=3)
102
102
 
103
103
    def test_remove_tree_repeatedly(self):
104
 
        self.run_bzr('remove-tree', 'branch1')
 
104
        self.run_bzr('remove-tree branch1')
105
105
        self.failIfExists('branch1/foo')
106
106
        output = self.run_bzr_error(["No working tree to remove"],
107
 
                                    'remove-tree', 'branch1', retcode=3)
 
107
                                    'remove-tree branch1', retcode=3)
108
108
 
109
109
    def test_remove_tree_remote_path(self):
110
110
        # TODO: I can't think of a way to implement this...