~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chunk_writer.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-28 03:01:04 UTC
  • mfrom: (3641.5.19 btree)
  • Revision ID: pqm@pqm.ubuntu.com-20080828030104-6a87mmhafprj1prs
(jam) Updates to the btree indexing code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
            # Create a line with this group
59
59
            lines.append(''.join(map(str, numbers)) + '\n')
60
60
        writer = chunk_writer.ChunkWriter(4096)
61
 
        for line in lines:
 
61
        for idx, line in enumerate(lines):
62
62
            if writer.write(line):
 
63
                self.assertEqual(46, idx)
63
64
                break
64
65
        bytes_list, unused, _ = writer.finish()
65
66
        node_bytes = self.check_chunk(bytes_list, 4096)
78
79
            # Create a line with this group
79
80
            lines.append(''.join(map(str, numbers)) + '\n')
80
81
        writer = chunk_writer.ChunkWriter(4096, 256)
81
 
        for line in lines:
 
82
        for idx, line in enumerate(lines):
82
83
            if writer.write(line):
 
84
                self.assertEqual(44, idx)
83
85
                break
 
86
        else:
 
87
            self.fail('We were able to write all lines')
84
88
        self.assertFalse(writer.write("A"*256, reserved=True))
85
89
        bytes_list, unused, _ = writer.finish()
86
90
        node_bytes = self.check_chunk(bytes_list, 4096)