def test_invalidRangeRequest(self):
    "\n        An incorrect range request (RFC 2616 defines a correct range request as\n        a Bytes-Unit followed by a '=' character followed by a specific range.\n        Only 'bytes' is defined) results in the range header value being logged\n        and a normal 200 response being sent.\n        "
    range = b'foobar=0-43'
    self.request.requestHeaders.addRawHeader(b'range', range)
    self.resource.render(self.request)
    expected = ('Ignoring malformed Range header %r' % (range.decode(),))
    self._assertLogged(expected)
    self.assertEqual(b''.join(self.request.written), self.payload)
    self.assertEqual(self.request.responseCode, http.OK)
    self.assertEqual(self.request.responseHeaders.getRawHeaders(b'content-length')[0], (b'%d' % (len(self.payload),)))
An incorrect range request (RFC 2616 defines a correct range request as
a Bytes-Unit followed by a '=' character followed by a specific range.
Only 'bytes' is defined) results in the range header value being logged
and a normal 200 response being sent.
def test_invalidRangeRequest(self):
    "\n        An incorrect range request (RFC 2616 defines a correct range request as\n        a Bytes-Unit followed by a '=' character followed by a specific range.\n        Only 'bytes' is defined) results in the range header value being logged\n        and a normal 200 response being sent.\n        "
    range = b'foobar=0-43'
    self.request.requestHeaders.addRawHeader(b'range', range)
    self.resource.render(self.request)
    expected = ('Ignoring malformed Range header %r' % (range.decode(),))
    self._assertLogged(expected)
    self.assertEqual(b.join(self.request.written), self.payload)
    self.assertEqual(self.request.responseCode, http.OK)
    self.assertEqual(self.request.responseHeaders.getRawHeaders(b'content-length')[0], (b'%d' % (len(self.payload),)))