1 """The test case itsself, and associated stuff"""
10 def parse_config(self
, config
):
13 for line
in config
.readlines():
14 line
= string
.strip(line
)
15 self
.files
.append({'file': line
, 'read': 0})
19 def verify_request(self
, req
):
20 """Check that the request is valid.
22 Also needs to update any internal 'read' stuff"""
25 ## This needs to be done using exceptions, maybe
29 if i
['file'] == req
.fname
:
32 self
.reason
= "File %s was read twice" % (req
.fname
)
38 self
.reason
= "File %s requested, expected %s" % (req
.fname
, i
['file'])
41 ### Simplistic for now...
42 res
= req
.headers
.getheader('Host')
51 self
.reason
= "%s not read" % (i
['file'])
52 return self
.res
, self
.reason
55 return self
.res
, self
.reason