/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 GitRepository.revision_graph_can_have_wrong_parents().

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
 
17
18
"""Tests for interfacing with a Git Branch"""
18
19
 
19
 
import dulwich as git
 
20
 
 
21
import dulwich
 
22
from dulwich.repo import (
 
23
    Repo as GitRepo,
 
24
    )
 
25
 
20
26
import os
21
27
 
22
28
from bzrlib import (
44
50
    _test_needs_features = [tests.GitCommandFeature]
45
51
 
46
52
    def test_open_existing(self):
47
 
        tests.run_git('init')
 
53
        GitRepo.init('.')
48
54
 
49
55
        thebranch = Branch.open('.')
50
56
        self.assertIsInstance(thebranch, branch.GitBranch)
51
57
 
 
58
    def test_repr(self):
 
59
        GitRepo.init('.')
 
60
        thebranch = Branch.open('.')
 
61
        self.assertEquals("LocalGitBranch('file://%s/', 'HEAD')" % self.test_dir, repr(thebranch))
 
62
 
52
63
    def test_last_revision_is_null(self):
53
 
        tests.run_git('init')
 
64
        GitRepo.init('.')
54
65
 
55
66
        thebranch = Branch.open('.')
56
67
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
58
69
                         thebranch.last_revision_info())
59
70
 
60
71
    def simple_commit_a(self):
61
 
        tests.run_git('init')
 
72
        GitRepo.init('.')
62
73
        self.build_tree(['a'])
63
74
        tests.run_git('add', 'a')
64
75
        tests.run_git('commit', '-m', 'a')
105
116
 
106
117
    def setUp(self):
107
118
        tests.TestCaseWithTransport.setUp(self)
108
 
        git.repo.Repo.create(self.test_dir)
 
119
        dulwich.repo.Repo.create(self.test_dir)
109
120
        self.git_branch = Branch.open(self.test_dir)
110
121
 
111
122
    def test_get_parent(self):
134
145
    def make_onerev_branch(self):
135
146
        os.mkdir("d")
136
147
        os.chdir("d")
137
 
        tests.run_git("init")
 
148
        GitRepo.init('.')
138
149
        bb = tests.GitBranchBuilder()
139
150
        bb.set_file("foobar", "foo\nbar\n", False)
140
151
        mark = bb.commit("Somebody <somebody@someorg.org>", "mymsg")