/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

Cope with open_branch() actually checking whether there is a branch present.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
    def test_open_existing(self):
58
58
        GitRepo.init('.')
59
 
 
60
 
        thebranch = Branch.open('.')
 
59
        d = BzrDir.open('.')
 
60
        thebranch = d.create_branch()
61
61
        self.assertIsInstance(thebranch, branch.GitBranch)
62
62
 
63
63
    def test_repr(self):
64
64
        GitRepo.init('.')
65
 
        thebranch = Branch.open('.')
 
65
        d = BzrDir.open('.')
 
66
        thebranch = d.create_branch()
66
67
        self.assertEquals("LocalGitBranch('file://%s/', 'HEAD')" % self.test_dir, repr(thebranch))
67
68
 
68
69
    def test_last_revision_is_null(self):
69
70
        GitRepo.init('.')
70
 
 
71
 
        thebranch = Branch.open('.')
 
71
        thedir = BzrDir.open('.')
 
72
        thebranch = thedir.create_branch()
72
73
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
73
74
        self.assertEqual((0, revision.NULL_REVISION),
74
75
                         thebranch.last_revision_info())
82
83
    def test_last_revision_is_valid(self):
83
84
        self.simple_commit_a()
84
85
        head = tests.run_git('rev-parse', 'HEAD').strip()
85
 
 
86
86
        thebranch = Branch.open('.')
87
87
        self.assertEqual(default_mapping.revision_id_foreign_to_bzr(head),
88
88
                         thebranch.last_revision())
122
122
    def setUp(self):
123
123
        tests.TestCaseWithTransport.setUp(self)
124
124
        dulwich.repo.Repo.create(self.test_dir)
125
 
        self.git_branch = Branch.open(self.test_dir)
 
125
        d = BzrDir.open(self.test_dir)
 
126
        self.git_branch = d.create_branch()
126
127
 
127
128
    def test_get_parent(self):
128
129
        self.assertIs(None, self.git_branch.get_parent())
239
240
class ForeignTestsBranchFactory(object):
240
241
 
241
242
    def make_empty_branch(self, transport):
242
 
        return LocalGitBzrDirFormat().initialize_on_transport(transport).open_branch()
 
243
        d = LocalGitBzrDirFormat().initialize_on_transport(transport)
 
244
        return d.create_branch()
243
245
 
244
246
    make_branch = make_empty_branch