/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_branches.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-08 23:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170608233031-3qavls2o7a1pqllj
Update imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Black-box tests for brz branches."""
19
19
 
20
 
from breezy.controldir import ControlDir
 
20
from breezy.bzrdir import BzrDir
21
21
from breezy.tests import TestCaseWithTransport
22
22
 
23
23
 
32
32
 
33
33
    def test_no_branch(self):
34
34
        # Listing the branches in a control directory without branches.
35
 
        self.run_bzr('init-shared-repo a')
 
35
        self.run_bzr('init-repo a')
36
36
        out, err = self.run_bzr('branches a')
37
37
        self.assertEqual(out, "")
38
38
 
39
39
    def test_default_current_dir(self):
40
40
        # "brz branches" list the branches in the current directory
41
41
        # if no location was specified.
42
 
        self.run_bzr('init-shared-repo a')
 
42
        self.run_bzr('init-repo a')
43
43
        out, err = self.run_bzr('branches', working_dir='a')
44
44
        self.assertEqual(out, "")
45
45
 
62
62
 
63
63
    def test_indicates_non_branch(self):
64
64
        t = self.make_branch_and_tree('a', format='development-colo')
65
 
        t.controldir.create_branch(name='another')
66
 
        t.controldir.create_branch(name='colocated')
 
65
        t.bzrdir.create_branch(name='another')
 
66
        t.bzrdir.create_branch(name='colocated')
67
67
        out, err = self.run_bzr('branches a')
68
68
        self.assertEqual(out, "* (default)\n"
69
 
                              "  another\n"
70
 
                              "  colocated\n")
 
69
                               "  another\n"
 
70
                               "  colocated\n")
71
71
 
72
72
    def test_indicates_branch(self):
73
73
        t = self.make_repository('a', format='development-colo')
74
 
        t.controldir.create_branch(name='another')
75
 
        branch = t.controldir.create_branch(name='colocated')
76
 
        t.controldir.set_branch_reference(target_branch=branch)
 
74
        t.bzrdir.create_branch(name='another')
 
75
        branch = t.bzrdir.create_branch(name='colocated')
 
76
        t.bzrdir.set_branch_reference(target_branch=branch)
77
77
        out, err = self.run_bzr('branches a')
78
78
        self.assertEqual(out, "  another\n"
79
 
                              "* colocated\n")
 
79
                               "* colocated\n")
80
80
 
81
81
    def test_shared_repos(self):
82
82
        self.make_repository('a', shared=True)
83
 
        ControlDir.create_branch_convenience('a/branch1')
84
 
        b = ControlDir.create_branch_convenience('a/branch2')
 
83
        BzrDir.create_branch_convenience('a/branch1')
 
84
        b = BzrDir.create_branch_convenience('a/branch2')
85
85
        b.create_checkout(lightweight=True, to_location='b')
86
86
        out, err = self.run_bzr('branches b')
87
87
        self.assertEqual(out, "  branch1\n"
88
 
                              "* branch2\n")
 
88
                               "* branch2\n")
89
89
 
90
90
    def test_standalone_branch(self):
91
91
        self.make_branch('a')