~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http_response.py

  • Committer: Vincent Ladeuil
  • Date: 2007-12-06 22:46:16 UTC
  • mto: (2929.3.16 https) (3097.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 3099.
  • Revision ID: v.ladeuil+lp@free.fr-20071206224616-wn217wlduoe4rdkh
Fix typos mentioned by spiv.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
    def test_invalid_accesses(self):
141
141
        """Test errors triggered by invalid accesses."""
142
142
 
143
 
        f =  self._file_size_unknown()
 
143
        f = self._file_size_unknown()
144
144
        self.assertRaises(errors.InvalidRange, f.seek, -1, 2)
145
145
 
146
146
        for builder, start in self.files:
149
149
        for builder, start in self.files[1:3]:
150
150
            self._check_file_boundaries(builder(), start)
151
151
 
152
 
        f =  self._file_multi_ranges()
 
152
        f = self._file_multi_ranges()
153
153
        self._check_accesses_inside_range(f, start=10)
154
154
        f.seek(40) # Will trigger the decoding and setting of the second range
155
155
        self.assertEquals(100, f.tell())
159
159
        self._check_beyond_range(self._file_single_range, start=10)
160
160
        self._check_beyond_range(self._file_multi_ranges, start=10)
161
161
 
162
 
        f =  self._file_multi_ranges()
 
162
        f = self._file_multi_ranges()
163
163
        f.seek(40) # Past the first range but before the second
164
164
        # Now the file is positioned at the second range start (100)
165
165
        self.assertRaises(errors.InvalidRange, f.seek, 41)
166
166
 
167
 
        f =  self._file_multi_ranges()
 
167
        f = self._file_multi_ranges()
168
168
        # We can seek across ranges but not beyond
169
169
        self.assertRaises(errors.InvalidRange, f.read, 127)
170
170
 
368
368
 
369
369
    def _build_HTTPMessage(self, raw_headers):
370
370
        status_and_headers = StringIO(raw_headers)
371
 
        # Get read of the status line
 
371
        # Get rid of the status line
372
372
        status_and_headers.readline()
373
373
        msg = httplib.HTTPMessage(status_and_headers)
374
374
        return msg