/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: 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:
16
16
 
17
17
"""Tests for indices."""
18
18
 
19
 
from ... import (
 
19
from .. import (
20
20
    errors,
21
21
    tests,
22
22
    transport,
23
23
    )
24
 
from .. import (
 
24
from ..sixish import int2byte
 
25
from ..bzr import (
25
26
    index as _mod_index,
26
27
    )
27
28
 
308
309
        builder = _mod_index.GraphIndexBuilder()
309
310
        for bad_char in bytearray(b'\t\n\x0b\x0c\r\x00 '):
310
311
            self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
311
 
                              (b'a%skey' % bytes([bad_char]), ), b'data')
 
312
                              (b'a%skey' % int2byte(bad_char), ), b'data')
312
313
        self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
313
314
                          (), b'data')
314
315
        self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
323
324
        builder = _mod_index.GraphIndexBuilder(key_elements=2)
324
325
        for bad_char in bytearray(b'\t\n\x0b\x0c\r\x00 '):
325
326
            self.assertRaises(_mod_index.BadIndexKey, builder.add_node,
326
 
                              (b'prefix', b'a%skey' % bytes([bad_char])), b'data')
 
327
                              (b'prefix', b'a%skey' % int2byte(bad_char)), b'data')
327
328
 
328
329
    def test_add_node_bad_data(self):
329
330
        builder = _mod_index.GraphIndexBuilder()