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

Hackishly fix tree references.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
"""Tests for ref handling."""
20
20
 
 
21
from dulwich.repo import DictRefsContainer
 
22
 
21
23
from bzrlib import tests
22
24
 
23
25
from bzrlib.plugins.git import refs
42
44
            refs.branch_name_to_ref(None, "mydefault"))
43
45
        self.assertEquals(None,
44
46
            refs.branch_name_to_ref(None))
45
 
 
46
 
 
47
 
class ExtractTagTests(tests.TestCase):
48
 
 
49
 
    def test_ignore_branch(self):
50
 
        self.assertEquals({},
51
 
            refs.extract_tags({
52
 
                "HEAD": "ref: foo", "refs/branches/blala": "la"}))
53
 
 
54
 
    def test_tags(self):
55
 
        self.assertEquals({"mytag": "mysha"},
56
 
            refs.extract_tags({
57
 
                "HEAD": "ref: foo", "refs/tags/mytag": "mysha"}))
58
 
 
59
 
    def test_ignores_peels(self):
60
 
        self.assertEquals({"mytag": "actualsha"},
61
 
            refs.extract_tags({
62
 
                "HEAD": "ref: foo",
63
 
                "refs/tags/mytag": "mysha",
64
 
                "refs/tags/mytag^{}": "actualsha"}))
65
 
 
66
 
    def test_non_ascii_name(self):
67
 
        self.assertEquals({u'myt\xe2g': "actualsha"},
68
 
            refs.extract_tags({
69
 
                "HEAD": "ref: foo",
70
 
                "refs/tags/myt\xc3\xa2g": "actualsha"}))
71
 
 
72
 
    def test_non_utf8_name(self):
73
 
        self.assertEquals({},
74
 
            refs.extract_tags({
75
 
                'refs/tags/LIBGEE_0_2_\xc20': "actualsha"}))