/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 tests/test_branch.py

Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    Branch,
38
38
    InterBranch,
39
39
    )
40
 
try:
41
 
    from bzrlib.controldir import (
42
 
        ControlDir,
43
 
        )
44
 
except ImportError:
45
 
    # bzr < 2.3
46
 
    from bzrlib.bzrdir import (
47
 
        BzrDir,
48
 
        )
49
 
    ControlDir = BzrDir
 
40
from bzrlib.bzrdir import (
 
41
    BzrDir,
 
42
    )
50
43
from bzrlib.repository import (
51
44
    Repository,
52
45
    )
65
58
 
66
59
    def test_open_existing(self):
67
60
        GitRepo.init('.')
68
 
        d = ControlDir.open('.')
 
61
        d = BzrDir.open('.')
69
62
        thebranch = d.create_branch()
70
63
        self.assertIsInstance(thebranch, branch.GitBranch)
71
64
 
72
65
    def test_repr(self):
73
66
        GitRepo.init('.')
74
 
        d = ControlDir.open('.')
 
67
        d = BzrDir.open('.')
75
68
        thebranch = d.create_branch()
76
69
        self.assertEquals("<LocalGitBranch('file://%s/', 'HEAD')>" % self.test_dir, repr(thebranch))
77
70
 
78
71
    def test_last_revision_is_null(self):
79
72
        GitRepo.init('.')
80
 
        thedir = ControlDir.open('.')
 
73
        thedir = BzrDir.open('.')
81
74
        thebranch = thedir.create_branch()
82
75
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
83
76
        self.assertEqual((0, revision.NULL_REVISION),
137
130
    def setUp(self):
138
131
        tests.TestCaseWithTransport.setUp(self)
139
132
        dulwich.repo.Repo.create(self.test_dir)
140
 
        d = ControlDir.open(self.test_dir)
 
133
        d = BzrDir.open(self.test_dir)
141
134
        self.git_branch = d.create_branch()
142
135
 
143
136
    def test_get_parent(self):
193
186
        return "d", (marks[mark1], marks[mark2])
194
187
 
195
188
    def clone_git_branch(self, from_url, to_url):
196
 
        from_dir = ControlDir.open(from_url)
 
189
        from_dir = BzrDir.open(from_url)
197
190
        to_dir = from_dir.sprout(to_url)
198
191
        return to_dir.open_branch()
199
192