389
389
mbp@sourcefrog.net-20050314025737-55eb441f430ab4ba
390
390
mbp@sourcefrog.net-20050314025901-d74aa93bb7ee8f62
392
--418470f848b63279b--\r\n'
392
--418470f848b63279b--\r
395
_multipart_squid_range_response = (206, """HTTP/1.0 206 Partial Content\r
396
Date: Thu, 31 Aug 2006 21:16:22 GMT\r
397
Server: Apache/2.2.2 (Unix) DAV/2\r
398
Last-Modified: Thu, 31 Aug 2006 17:57:06 GMT\r
399
Accept-Ranges: bytes\r
400
Content-Type: multipart/byteranges; boundary="squid/2.5.STABLE12:C99323425AD4FE26F726261FA6C24196"\r
401
Content-Length: 598\r
402
X-Cache: MISS from localhost.localdomain\r
403
X-Cache-Lookup: HIT from localhost.localdomain:3128\r
404
Proxy-Connection: keep-alive\r
408
--squid/2.5.STABLE12:C99323425AD4FE26F726261FA6C24196\r
409
Content-Type: text/plain\r
410
Content-Range: bytes 0-99/18672\r
414
scott@netsplit.com-20050708230047-47c7868f276b939f fulltext 0 863 :
416
--squid/2.5.STABLE12:C99323425AD4FE26F726261FA6C24196\r
417
Content-Type: text/plain\r
418
Content-Range: bytes 300-499/18672\r
420
com-20050708231537-2b124b835395399a :
421
scott@netsplit.com-20050820234126-551311dbb7435b51 line-delta 1803 479 .scott@netsplit.com-20050820232911-dc4322a084eadf7e :
422
scott@netsplit.com-20050821213706-c86\r
423
--squid/2.5.STABLE12:C99323425AD4FE26F726261FA6C24196--\r
476
507
self.check_header('Content-Type',
477
508
'multipart/byteranges; boundary=418470f848b63279b')
510
def test_multi_squid_range(self):
511
self.use_response(_multipart_squid_range_response)
513
self.check_header('Content-Length', '598')
514
self.check_header('Content-Type',
515
'multipart/byteranges; '\
516
'boundary="squid/2.5.STABLE12:C99323425AD4FE26F726261FA6C24196"')
479
518
def test_redirect(self):
480
519
"""We default to returning the last group of headers in the file."""
481
520
self.use_response(_redirect_response)
603
def test_multi_squid_range(self):
604
out = self.get_response(_multipart_squid_range_response)
605
self.assertIsInstance(out, response.HttpMultipartRangeResponse)
607
# Just make sure we can read the right contents
564
614
def test_invalid_response(self):
565
615
self.assertRaises(errors.InvalidHttpResponse,
566
616
self.get_response, _invalid_response)