Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (21 sloc) 0.868 kb
import random
import string
from base import *
from util import *
LENGTH = 100*1024
OFFSET = 15
class Test (TestBase):
def __init__ (self):
TestBase.__init__ (self, __file__)
self.name = "Content Range 100k, end"
self.request = "GET /Range100k2 HTTP/1.0\r\n" +\
"Range: bytes=-%d\r\n" % (OFFSET)
self.expected_error = 206
def Prepare (self, www):
srandom = str_random (LENGTH)
self.WriteFile (www, "Range100k2", 0444, srandom)
forbidden = self.WriteTemp (srandom[OFFSET:])
self.expected_content = [srandom[-OFFSET:],
"Content-Length: %d" % (OFFSET),
"Content-Range: bytes %d-%d/%d" % (LENGTH-OFFSET, LENGTH-1, LENGTH)]
self.forbidden_content = "file:" + forbidden
Jump to Line
Something went wrong with that request. Please try again.