/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

Special-case NULL_REVISION when looking for Git shas.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        GitRepo.init('.')
65
65
        d = BzrDir.open('.')
66
66
        thebranch = d.create_branch()
67
 
        self.assertEquals("<LocalGitBranch('file://%s/', 'refs/heads/master')>" % self.test_dir, repr(thebranch))
 
67
        self.assertEquals("<LocalGitBranch('file://%s/', 'HEAD')>" % self.test_dir, repr(thebranch))
68
68
 
69
69
    def test_last_revision_is_null(self):
70
70
        GitRepo.init('.')
115
115
        self.assertEquals({"foo": default_mapping.revision_id_foreign_to_bzr(reva)},
116
116
                          thebranch.tags.get_tag_dict())
117
117
 
118
 
        
 
118
 
119
119
 
120
120
class TestWithGitBranch(tests.TestCaseWithTransport):
121
121
 
129
129
        self.assertIs(None, self.git_branch.get_parent())
130
130
 
131
131
    def test_get_stacked_on_url(self):
132
 
        self.assertRaises(errors.UnstackableBranchFormat, 
 
132
        self.assertRaises(errors.UnstackableBranchFormat,
133
133
            self.git_branch.get_stacked_on_url)
134
134
 
135
135
    def test_get_physical_lock_status(self):
145
145
    def test_get_format_description(self):
146
146
        self.assertEquals("Git Branch", self.format.get_format_description())
147
147
 
 
148
    def test_get_network_name(self):
 
149
        self.assertEquals("git", self.format.network_name())
 
150
 
 
151
    def test_supports_tags(self):
 
152
        self.assertTrue(self.format.supports_tags())
148
153
 
149
154
 
150
155
class BranchTests(tests.TestCaseInTempDir):
246
251
    make_branch = make_empty_branch
247
252
 
248
253
 
249
 
class BranchNameRefConversionTests(tests.TestCase):
250
 
 
251
 
    def test_head(self):
252
 
        self.assertEquals("HEAD", branch.ref_to_branch_name("HEAD"))
253
 
        self.assertEquals("HEAD", branch.branch_name_to_ref("HEAD"))
254
 
 
255
 
    def test_tag(self):
256
 
        self.assertRaises(ValueError, branch.ref_to_branch_name, "refs/tags/FOO")
257
 
 
258
 
    def test_branch(self):
259
 
        self.assertEquals("frost", branch.ref_to_branch_name("refs/heads/frost"))
260
 
        self.assertEquals("refs/heads/frost", branch.branch_name_to_ref("frost"))
261
 
 
262
 
    def test_default(self):
263
 
        self.assertEquals("mydefault",
264
 
            branch.branch_name_to_ref(None, "mydefault"))
265
 
        self.assertEquals(None,
266
 
            branch.branch_name_to_ref(None))
267
 
 
268
254