~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_join.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:
39
39
 
40
40
    def test_join(self):
41
41
        base_tree, sub_tree = self.make_trees()
42
 
        self.run_bzr('join', 'tree/subtree')
 
42
        self.run_bzr('join tree/subtree')
43
43
        self.check_success('tree')
44
44
 
45
45
    def test_join_dot(self):
46
46
        base_tree, sub_tree = self.make_trees()
47
 
        self.run_bzr('join', '.', working_dir='tree/subtree')
 
47
        self.run_bzr('join .', working_dir='tree/subtree')
48
48
        self.check_success('tree')
49
49
 
50
50
    def test_join_error(self):
53
53
        os.rename('tree/subtree', 'tree/subtree2/subtree')
54
54
        self.run_bzr_error(
55
55
            ('Cannot join .*subtree.  Parent directory is not versioned',),
56
 
             'join', 'tree/subtree2/subtree')
 
56
             'join tree/subtree2/subtree')
57
57
        # disabled because this gives an ugly error at present -- mbp 20070306
58
58
        ## self.run_bzr_error(
59
59
        ##     ('Cannot join .*subtree.  Parent directory is not versioned',),
60
60
        ##      'join', '--reference', 'tree/subtree2/subtree')
61
 
        self.run_bzr_error(('Not a branch:.*subtree2',), 'join',
62
 
                            'tree/subtree2')
 
61
        self.run_bzr_error(('Not a branch:.*subtree2',),
 
62
                           'join tree/subtree2')
63
63
 
64
64
    def test_join_reference(self):
65
65
        """Join can add a reference if --reference is supplied"""
66
66
        base_tree, sub_tree = self.make_trees()
67
 
        self.run_bzr('join', '.', '--reference', working_dir='tree/subtree')
 
67
        self.run_bzr('join . --reference', working_dir='tree/subtree')
68
68
        sub_tree.lock_read()
69
69
        self.addCleanup(sub_tree.unlock)
70
70
        self.assertEqual('file1-id', sub_tree.path2id('file1'))
85
85
        # cannot.
86
86
        tree = self.make_branch_and_tree('tree', format='dirstate')
87
87
        tree2 = self.make_branch_and_tree('tree/subtree')
88
 
        out, err = self.run_bzr('join', '--reference', 'tree/subtree',
89
 
            retcode=3)
90
 
        self.assertContainsRe(err,
91
 
            r"Can't join trees")
92
 
        self.assertContainsRe(err,
93
 
            r"use bzr upgrade")
 
88
        out, err = self.run_bzr('join --reference tree/subtree',
 
89
                                retcode=3)
 
90
        self.assertContainsRe(err, r"Can't join trees")
 
91
        self.assertContainsRe(err, r"use bzr upgrade")
94
92
 
95
93