forked from cherokee/webserver
/
042-Pipelining.py
32 lines (26 loc) · 1.35 KB
/
042-Pipelining.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from base import *
MAGIC = "This is the file number %s."
class Test (TestBase):
def __init__ (self):
TestBase.__init__ (self, __file__)
self.name = "Pipelining"
self.request = "GET /pipe1/file1 HTTP/1.1\r\n" +\
"Host: localhost\r\n" +\
"Connection: Keep-alive\r\n" +\
"\r\n" +\
"GET /pipe1/file2 HTTP/1.1\r\n" +\
"Host: localhost\r\n" +\
"Connection: Keep-alive\r\n" +\
"\r\n" +\
"GET /pipe1/file3 HTTP/1.1\r\n" +\
"Host: localhost\r\n" +\
"Connection: Close\r\n"
self.expected_error = 200
self.expected_content = [ MAGIC %("one"),
MAGIC %("two"),
MAGIC %("three") ]
def Prepare (self, www):
self.Mkdir (www, "pipe1")
self.WriteFile (www, "pipe1/file1", 0444, MAGIC %("one"))
self.WriteFile (www, "pipe1/file2", 0444, MAGIC %("two"))
self.WriteFile (www, "pipe1/file3", 0444, MAGIC %("three"))