/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 breezy/plugins/git/tests/test_refs.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-05-15 18:47:57 UTC
  • mfrom: (6964.2.7 python3-git)
  • Revision ID: breezy.the.bot@gmail.com-20180515184757-xozniaj9gztgtom8
Port some of brz-git to python3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-git/+merge/345479

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
class BranchNameRefConversionTests(tests.TestCase):
34
34
 
35
35
    def test_head(self):
36
 
        self.assertEquals("", ref_to_branch_name("HEAD"))
37
 
        self.assertEquals("HEAD", branch_name_to_ref(""))
 
36
        self.assertEqual("", ref_to_branch_name(b"HEAD"))
 
37
        self.assertEqual(b"HEAD", branch_name_to_ref(""))
38
38
 
39
39
    def test_tag(self):
40
 
        self.assertRaises(ValueError, ref_to_branch_name, "refs/tags/FOO")
 
40
        self.assertRaises(ValueError, ref_to_branch_name, b"refs/tags/FOO")
41
41
 
42
42
    def test_branch(self):
43
 
        self.assertEquals("frost", ref_to_branch_name("refs/heads/frost"))
44
 
        self.assertEquals("refs/heads/frost", branch_name_to_ref("frost"))
 
43
        self.assertEqual("frost", ref_to_branch_name(b"refs/heads/frost"))
 
44
        self.assertEqual(b"refs/heads/frost", branch_name_to_ref("frost"))
45
45
 
46
46
 
47
47
class BazaarRefsContainerTests(tests.TestCaseWithTransport):
59
59
        refs = BazaarRefsContainer(tree.controldir, store)
60
60
        self.assertEqual(
61
61
                refs.as_dict(),
62
 
                {'HEAD': store._lookup_revision_sha1(revid)})
 
62
                {b'HEAD': store._lookup_revision_sha1(revid)})
63
63
 
64
64
    def test_some_tag(self):
65
65
        tree = self.make_branch_and_tree('.')
69
69
        refs = BazaarRefsContainer(tree.controldir, store)
70
70
        self.assertEqual(
71
71
                refs.as_dict(),
72
 
                {'HEAD': store._lookup_revision_sha1(revid),
73
 
                 'refs/tags/sometag': store._lookup_revision_sha1(revid),
 
72
                {b'HEAD': store._lookup_revision_sha1(revid),
 
73
                 b'refs/tags/sometag': store._lookup_revision_sha1(revid),
74
74
                 })
75
75
 
76
76
    def test_some_branch(self):
82
82
        refs = BazaarRefsContainer(tree.controldir, store)
83
83
        self.assertEqual(
84
84
                refs.as_dict(),
85
 
                {'HEAD': store._lookup_revision_sha1(revid),
86
 
                 'refs/heads/otherbranch': store._lookup_revision_sha1(revid),
 
85
                {b'HEAD': store._lookup_revision_sha1(revid),
 
86
                 b'refs/heads/otherbranch': store._lookup_revision_sha1(revid),
87
87
                 })