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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    tests,
22
22
    transport,
23
23
    )
24
 
from ..sixish import int2byte
25
24
from ..bzr import (
26
25
    index as _mod_index,
27
26
    )
309
308
        builder = _mod_index.GraphIndexBuilder()
310
309
        for bad_char in bytearray(b'\t\n\x0b\x0c\r\x00 '):
311
310
            self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
312
 
                              (b'a%skey' % int2byte(bad_char), ), b'data')
 
311
                              (b'a%skey' % bytes([bad_char]), ), b'data')
313
312
        self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
314
313
                          (), b'data')
315
314
        self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
324
323
        builder = _mod_index.GraphIndexBuilder(key_elements=2)
325
324
        for bad_char in bytearray(b'\t\n\x0b\x0c\r\x00 '):
326
325
            self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
327
 
                              (b'prefix', b'a%skey' % int2byte(bad_char)), b'data')
 
326
                              (b'prefix', b'a%skey' % bytes([bad_char])), b'data')
328
327
 
329
328
    def test_add_node_bad_data(self):
330
329
        builder = _mod_index.GraphIndexBuilder()