/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_git_branch.py

More refactoring. Add some direct tests for GitModel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import subprocess
20
20
 
21
 
from bzrlib import branch
 
21
from bzrlib import branch, revision
22
22
 
23
23
from bzrlib.plugins.git import tests
24
24
from bzrlib.plugins.git.gitlib import git_branch
29
29
    _test_needs_features = [tests.GitCommandFeature]
30
30
 
31
31
    def test_open_existing(self):
32
 
        p = subprocess.Popen(['git', 'init'],
33
 
                             stdout=subprocess.PIPE,
34
 
                             stderr=subprocess.PIPE)
35
 
        p.communicate()
36
 
 
37
 
        gd = branch.Branch.open('.')
38
 
        self.assertIsInstance(gd, git_branch.GitBranch)
39
 
 
 
32
        tests.run_git('init')
 
33
 
 
34
        thebranch = branch.Branch.open('.')
 
35
        self.assertIsInstance(thebranch, git_branch.GitBranch)
 
36
 
 
37
    def test_last_revision_is_null(self):
 
38
        tests.run_git('init')
 
39
 
 
40
        thebranch = branch.Branch.open('.')
 
41
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
 
42
        self.assertEqual((0, revision.NULL_REVISION),
 
43
                         thebranch.last_revision_info())