mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
clean a litle the rep
This commit is contained in:
parent
b568852465
commit
6da023a7da
19943
examples/test.log
19943
examples/test.log
File diff suppressed because it is too large
Load Diff
@ -50,7 +50,6 @@ class Worker(object):
|
||||
self.app = app
|
||||
self.alive = True
|
||||
self.log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def close_on_exec(self, fd):
|
||||
flags = fcntl.fcntl(fd, fcntl.F_GETFD) | fcntl.FD_CLOEXEC
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
HTTP/1.1 301 Moved Permanently
|
||||
Location: http://www.google.com/
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Date: Sun, 26 Apr 2009 11:11:49 GMT
|
||||
Expires: Tue, 26 May 2009 11:11:49 GMT
|
||||
Cache-Control: public, max-age=2592000
|
||||
Server: gws
|
||||
Content-Length: 219
|
||||
|
||||
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<TITLE>301 Moved</TITLE></HEAD><BODY>
|
||||
<H1>301 Moved</H1>
|
||||
The document has moved
|
||||
<A HREF="http://www.google.com/">here</A>.
|
||||
</BODY></HTML>
|
||||
@ -1,16 +0,0 @@
|
||||
HTTP/1.1 200 OK
|
||||
Date: Tue, 04 Aug 2009 07:59:32 GMT
|
||||
Server: Apache
|
||||
X-Powered-By: Servlet/2.5 JSP/2.1
|
||||
Content-Type: text/xml; charset=utf-8
|
||||
Connection: close
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<SOAP-ENV:Body>
|
||||
<SOAP-ENV:Fault>
|
||||
<faultcode>SOAP-ENV:Client</faultcode>
|
||||
<faultstring>Client Error</faultstring>
|
||||
</SOAP-ENV:Fault>
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>
|
||||
@ -1,2 +0,0 @@
|
||||
HTTP/1.1 404 Not Found
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
HTTP/1.1 301
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: text/plain
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
25
|
||||
This is the data in the first chunk
|
||||
|
||||
1C
|
||||
and this is the second one
|
||||
|
||||
0
|
||||
@ -1,5 +0,0 @@
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: text/html; charset=utf-8
|
||||
Connection: close
|
||||
|
||||
these headers are from http://news.ycombinator.com/
|
||||
@ -1,7 +0,0 @@
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Length: 11
|
||||
Proxy-Connection: close
|
||||
Date: Thu, 31 Dec 2009 20:55:48 +0000
|
||||
|
||||
hello world
|
||||
15
tests/t.py
15
tests/t.py
@ -37,11 +37,12 @@ class request(object):
|
||||
|
||||
class FakeSocket(object):
|
||||
|
||||
def __init__(self, data):
|
||||
def __init__(self, data=""):
|
||||
self.tmp = tempfile.TemporaryFile()
|
||||
self.tmp.write(data)
|
||||
self.tmp.flush()
|
||||
self.tmp.seek(0)
|
||||
if data:
|
||||
self.tmp.write(data)
|
||||
self.tmp.flush()
|
||||
self.tmp.seek(0)
|
||||
|
||||
def fileno(self):
|
||||
return self.tmp.fileno()
|
||||
@ -52,6 +53,10 @@ class FakeSocket(object):
|
||||
def recv(self, length=None):
|
||||
return self.tmp.read()
|
||||
|
||||
def send(self, data):
|
||||
self.tmp.write(data)
|
||||
self.tmp.flush()
|
||||
|
||||
def seek(self, offset, whence=0):
|
||||
self.tmp.seek(offset, whence)
|
||||
|
||||
@ -63,8 +68,6 @@ class http_request(object):
|
||||
def __call__(self, func):
|
||||
def run():
|
||||
fsock = FakeSocket(data_source(self.fname))
|
||||
|
||||
|
||||
req = HttpRequest(fsock, ('127.0.0.1', 6000),
|
||||
('127.0.0.1', 8000))
|
||||
func(req)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user