Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 27 lines (20 sloc) 0.78 kb
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97f1-...
alobbs authored
1 import random
2 import string
3 from base import *
4 from util import *
5
6 MAGIC = str_random (100)
7 LENGTH = 100
8 OFFSET = 15
9
10
11 class Test (TestBase):
12 def __init__ (self):
bc8d926 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-97f1...
alobbs authored
13 TestBase.__init__ (self, __file__)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97f1-...
alobbs authored
14 self.name = "Content Range, end"
15
16 self.request = "GET /Range100b2 HTTP/1.0\r\n" +\
17 "Range: bytes=-%d\r\n" % (OFFSET)
18 self.expected_error = 206
9134084 @alobbs Fixes Range management while serving static files. Patch by Antonio
alobbs authored
19 self.expected_content = [MAGIC[-OFFSET:],
20 "Content-Length: %d" % (OFFSET),
21 "Content-Range: bytes %d-%d/%d" % (LENGTH-OFFSET, LENGTH-1, LENGTH)]
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97f1-...
alobbs authored
22 self.forbidden_content = MAGIC[OFFSET:]
23
24 def Prepare (self, www):
25 self.WriteFile (www, "Range100b2", 0444, MAGIC)
26
Something went wrong with that request. Please try again.