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

  • Committer: Jelmer Vernooij
  • Date: 2018-05-15 19:05:51 UTC
  • mfrom: (6968 work)
  • mto: (6973.5.1 python3-c)
  • mto: This revision was merged to the branch mainline in revision 6984.
  • Revision ID: jelmer@jelmer.uk-20180515190551-epr5abd0mtxmrehr
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
from cStringIO import StringIO
 
21
from io import BytesIO
22
22
 
23
23
from ....tests import (
24
24
    TestCaseWithTransport,
36
36
        self.assertIs(None, m.peel_tag("ab"* 20))
37
37
 
38
38
    def test_load(self):
39
 
        f = StringIO(
40
 
            "unpeel map version 1\n"
41
 
            "0123456789012345678901234567890123456789: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
 
39
        f = BytesIO(
 
40
            b"unpeel map version 1\n"
 
41
            b"0123456789012345678901234567890123456789: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
42
42
        m = UnpeelMap()
43
43
        m.load(f)
44
 
        self.assertEquals("0123456789012345678901234567890123456789",
45
 
            m.peel_tag("aa"*20))
 
44
        self.assertEqual(b"0123456789012345678901234567890123456789",
 
45
            m.peel_tag(b"aa"*20))
46
46
 
47
47
    def test_update(self):
48
48
        m = UnpeelMap()
49
49
        m.update({
50
 
           "0123456789012345678901234567890123456789": set(["aa" * 20]),
 
50
           b"0123456789012345678901234567890123456789": set([b"aa" * 20]),
51
51
           })
52
 
        self.assertEquals("0123456789012345678901234567890123456789",
53
 
            m.peel_tag("aa"*20))
 
52
        self.assertEqual(b"0123456789012345678901234567890123456789",
 
53
            m.peel_tag(b"aa"*20))