/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

Eliminate (duplicate) git_ prefix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import git
20
20
 
21
 
from bzrlib import branch, revision
 
21
from bzrlib import revision
 
22
from bzrlib.branch import Branch
22
23
 
23
24
from bzrlib.plugins.git import tests
24
25
from bzrlib.plugins.git import (
25
 
    git_branch,
 
26
    branch,
26
27
    ids,
27
28
    )
28
29
 
34
35
    def test_open_existing(self):
35
36
        tests.run_git('init')
36
37
 
37
 
        thebranch = branch.Branch.open('.')
38
 
        self.assertIsInstance(thebranch, git_branch.GitBranch)
 
38
        thebranch = Branch.open('.')
 
39
        self.assertIsInstance(thebranch, branch.GitBranch)
39
40
 
40
41
    def test_last_revision_is_null(self):
41
42
        tests.run_git('init')
42
43
 
43
 
        thebranch = branch.Branch.open('.')
 
44
        thebranch = Branch.open('.')
44
45
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
45
46
        self.assertEqual((0, revision.NULL_REVISION),
46
47
                         thebranch.last_revision_info())
55
56
        self.simple_commit_a()
56
57
        head = tests.run_git('rev-parse', 'HEAD').strip()
57
58
 
58
 
        thebranch = branch.Branch.open('.')
 
59
        thebranch = Branch.open('.')
59
60
        self.assertEqual(ids.convert_revision_id_git_to_bzr(head),
60
61
                         thebranch.last_revision())
61
62
 
67
68
        tests.run_git('commit', '-m', 'b')
68
69
        revb = tests.run_git('rev-parse', 'HEAD').strip()
69
70
 
70
 
        thebranch = branch.Branch.open('.')
 
71
        thebranch = Branch.open('.')
71
72
        self.assertEqual([ids.convert_revision_id_git_to_bzr(r) for r in (reva, revb)],
72
73
                         thebranch.revision_history())
73
74
 
79
80
        
80
81
        newid = open('.git/refs/tags/foo').read().rstrip()
81
82
 
82
 
        thebranch = branch.Branch.open('.')
 
83
        thebranch = Branch.open('.')
83
84
        self.assertEquals({"foo": ids.convert_revision_id_git_to_bzr(newid)},
84
85
                          thebranch.tags.get_tag_dict())
85
86
        
89
90
    def setUp(self):
90
91
        tests.TestCaseWithTransport.setUp(self)
91
92
        git.repo.Repo.create(self.test_dir)
92
 
        self.git_branch = branch.Branch.open(self.test_dir)
 
93
        self.git_branch = Branch.open(self.test_dir)
93
94
 
94
95
    def test_get_parent(self):
95
96
        self.assertIs(None, self.git_branch.get_parent())
105
106
 
106
107
    def setUp(self):
107
108
        super(TestGitBranchFormat, self).setUp()
108
 
        self.format = git_branch.GitBranchFormat()
 
109
        self.format = branch.GitBranchFormat()
109
110
 
110
111
    def test_get_format_description(self):
111
112
        self.assertEquals("Git Branch", self.format.get_format_description())