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

  • Committer: Aaron Bentley
  • Date: 2008-02-24 16:42:13 UTC
  • mfrom: (3234 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3235.
  • Revision ID: aaron@aaronbentley.com-20080224164213-eza1lzru5bwuwmmj
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        f._pos = 0 # Force an invalid pos
250
250
        self.assertRaises(errors.InvalidRange, f.read, 2)
251
251
 
252
 
class TestRangeFilMultipleRanges(tests.TestCase, TestRangeFileMixin):
 
252
class TestRangeFileMultipleRanges(tests.TestCase, TestRangeFileMixin):
253
253
    """Test a RangeFile for multiple ranges.
254
254
 
255
255
    The RangeFile used for the tests contains three ranges:
263
263
    """
264
264
 
265
265
    def setUp(self):
266
 
        super(TestRangeFilMultipleRanges, self).setUp()
 
266
        super(TestRangeFileMultipleRanges, self).setUp()
267
267
 
268
268
        boundary = 'separation'
269
269
 
361
361
        f.seek(126) # skip the two first ranges
362
362
        self.assertEquals('AB', f.read(2))
363
363
 
 
364
    def test_checked_read_dont_overflow_buffers(self):
 
365
        f = self._file
 
366
        start = self.first_range_start
 
367
        # We force a very low value to exercise all code paths in _checked_read
 
368
        f._discarded_buf_size = 8
 
369
        f.seek(126) # skip the two first ranges
 
370
        self.assertEquals('AB', f.read(2))
 
371
 
364
372
    def test_seek_twice_between_ranges(self):
365
373
        f = self._file
366
374
        start = self.first_range_start