/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

Implement to_files() for git merge directives.

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
 
        d = BzrDir.open('.')
60
 
        thebranch = d.create_branch()
 
59
 
 
60
        thebranch = Branch.open('.')
61
61
        self.assertIsInstance(thebranch, branch.GitBranch)
62
62
 
63
63
    def test_repr(self):
64
64
        GitRepo.init('.')
65
 
        d = BzrDir.open('.')
66
 
        thebranch = d.create_branch()
67
 
        self.assertEquals("<LocalGitBranch('file://%s/', 'refs/heads/master')>" % self.test_dir, repr(thebranch))
 
65
        thebranch = Branch.open('.')
 
66
        self.assertEquals("LocalGitBranch('file://%s/', 'HEAD')" % self.test_dir, repr(thebranch))
68
67
 
69
68
    def test_last_revision_is_null(self):
70
69
        GitRepo.init('.')
71
 
        thedir = BzrDir.open('.')
72
 
        thebranch = thedir.create_branch()
 
70
 
 
71
        thebranch = Branch.open('.')
73
72
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
74
73
        self.assertEqual((0, revision.NULL_REVISION),
75
74
                         thebranch.last_revision_info())
83
82
    def test_last_revision_is_valid(self):
84
83
        self.simple_commit_a()
85
84
        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
 
        d = BzrDir.open(self.test_dir)
126
 
        self.git_branch = d.create_branch()
 
125
        self.git_branch = Branch.open(self.test_dir)
127
126
 
128
127
    def test_get_parent(self):
129
128
        self.assertIs(None, self.git_branch.get_parent())
240
239
class ForeignTestsBranchFactory(object):
241
240
 
242
241
    def make_empty_branch(self, transport):
243
 
        d = LocalGitBzrDirFormat().initialize_on_transport(transport)
244
 
        return d.create_branch()
 
242
        return LocalGitBzrDirFormat().initialize_on_transport(transport).open_branch()
245
243
 
246
244
    make_branch = make_empty_branch
247
 
 
248
 
 
249