/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

Rely less on command-line git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
 
21
21
import dulwich
 
22
from dulwich.repo import (
 
23
    Repo as GitRepo,
 
24
    )
 
25
 
22
26
import os
23
27
 
24
28
from bzrlib import (
46
50
    _test_needs_features = [tests.GitCommandFeature]
47
51
 
48
52
    def test_open_existing(self):
49
 
        tests.run_git('init')
 
53
        GitRepo.init('.')
50
54
 
51
55
        thebranch = Branch.open('.')
52
56
        self.assertIsInstance(thebranch, branch.GitBranch)
53
57
 
54
58
    def test_repr(self):
55
 
        tests.run_git('init')
 
59
        GitRepo.init('.')
56
60
        thebranch = Branch.open('.')
57
61
        self.assertEquals("LocalGitBranch('file://%s/', 'HEAD')" % self.test_dir, repr(thebranch))
58
62
 
59
63
    def test_last_revision_is_null(self):
60
 
        tests.run_git('init')
 
64
        GitRepo.init('.')
61
65
 
62
66
        thebranch = Branch.open('.')
63
67
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
65
69
                         thebranch.last_revision_info())
66
70
 
67
71
    def simple_commit_a(self):
68
 
        tests.run_git('init')
 
72
        GitRepo.init('.')
69
73
        self.build_tree(['a'])
70
74
        tests.run_git('add', 'a')
71
75
        tests.run_git('commit', '-m', 'a')
141
145
    def make_onerev_branch(self):
142
146
        os.mkdir("d")
143
147
        os.chdir("d")
144
 
        tests.run_git("init")
 
148
        GitRepo.init('.')
145
149
        bb = tests.GitBranchBuilder()
146
150
        bb.set_file("foobar", "foo\nbar\n", False)
147
151
        mark = bb.commit("Somebody <somebody@someorg.org>", "mymsg")