/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/tests/test__btree_serializer.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import binascii
21
21
import bisect
22
22
 
23
 
from ... import tests
 
23
from .. import tests
 
24
from ..sixish import (
 
25
    int2byte,
 
26
    )
24
27
 
25
28
from .test_btree_index import compiled_btreeparser_feature
26
29
 
57
60
        self.assertIs(None, self.module._py_unhexlify(as_hex))
58
61
 
59
62
    def test_to_hex(self):
60
 
        raw_bytes = bytes(range(256))
 
63
        raw_bytes = b''.join(map(int2byte, range(256)))
61
64
        for i in range(0, 240, 20):
62
65
            self.assertHexlify(raw_bytes[i:i + 20])
63
66
        self.assertHexlify(raw_bytes[240:] + raw_bytes[0:4])
67
70
        self.assertUnhexlify(b'123456789abcdef0123456789abcdef012345678')
68
71
        self.assertUnhexlify(b'0123456789ABCDEF0123456789ABCDEF01234567')
69
72
        self.assertUnhexlify(b'123456789ABCDEF0123456789ABCDEF012345678')
70
 
        hex_chars = binascii.hexlify(bytes(range(256)))
 
73
        hex_chars = binascii.hexlify(b''.join(map(int2byte, range(256))))
71
74
        for i in range(0, 480, 40):
72
75
            self.assertUnhexlify(hex_chars[i:i + 40])
73
76
        self.assertUnhexlify(hex_chars[480:] + hex_chars[0:8])