~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(gz) Never raise KnownFailure in tests,
 use knownFailure method instead (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
class TestRemoveBranch(TestCaseWithTransport):
29
29
 
30
 
    def example_branch(self, path='.', format=None):
31
 
        tree = self.make_branch_and_tree(path, format=format)
 
30
    def example_branch(self, path='.'):
 
31
        tree = self.make_branch_and_tree(path)
32
32
        self.build_tree_contents([(path + '/hello', 'foo')])
33
33
        tree.add('hello')
34
34
        tree.commit(message='setup')
35
35
        self.build_tree_contents([(path + '/goodbye', 'baz')])
36
36
        tree.add('goodbye')
37
37
        tree.commit(message='setup')
38
 
        return tree
39
38
 
40
39
    def test_remove_local(self):
41
40
        # Remove a local branch.
58
57
        self.run_bzr('rmbranch', working_dir='a')
59
58
        dir = bzrdir.BzrDir.open('a')
60
59
        self.assertFalse(dir.has_branch())
61
 
 
62
 
    def test_remove_colo(self):
63
 
        # Remove a colocated branch.
64
 
        tree = self.example_branch('a', format='development-colo')
65
 
        tree.bzrdir.create_branch(name="otherbranch")
66
 
        self.assertTrue(tree.bzrdir.has_branch('otherbranch'))
67
 
        self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url)
68
 
        dir = bzrdir.BzrDir.open('a')
69
 
        self.assertFalse(dir.has_branch('otherbranch'))
70
 
        self.assertTrue(dir.has_branch())
71
 
 
72
 
 
73
 
class TestSmartServerRemoveBranch(TestCaseWithTransport):
74
 
 
75
 
    def test_simple_remove_branch(self):
76
 
        self.setup_smart_server_with_call_log()
77
 
        self.make_branch('branch')
78
 
        self.reset_smart_call_log()
79
 
        out, err = self.run_bzr(['rmbranch', self.get_url('branch')])
80
 
        # This figure represent the amount of work to perform this use case. It
81
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
82
 
        # being too low. If rpc_count increases, more network roundtrips have
83
 
        # become necessary for this use case. Please do not adjust this number
84
 
        # upwards without agreement from bzr's network support maintainers.
85
 
        self.assertLength(5, self.hpss_calls)