Exemplo n.º 1
0
class Response(object):
    def __init__(self, request_id):
        self.request_id = request_id
        self.stdout = InputStream()
        self.stderr = InputStream()
        self.request_status = None
        self.app_status = None

    def parse(self):
        headers, body = self.stdout.read().split(b'\r\n\r\n', 1)
        headers = dict(
            header.split(b': ', 1) for header in headers.split(b'\r\n'))
        return headers, body
Exemplo n.º 2
0
class Response(object):

    def __init__(self, request_id):
        self.request_id = request_id
        self.stdout = InputStream()
        self.stderr = InputStream()
        self.request_status = None
        self.app_status = None

    def parse(self):
        headers, body = self.stdout.read().split('\r\n\r\n', 1)
        headers = dict(
            header.split(': ', 1) for header in headers.split('\r\n'))
        return headers, body
Exemplo n.º 3
0
 def setUp(self):
     self.sock = MockSocket()
     self.conn = Connection(self.sock)
     self.stream = InputStream()
Exemplo n.º 4
0
 def __init__(self, request_id):
     self.request_id = request_id
     self.stdout = InputStream()
     self.stderr = InputStream()
     self.request_status = None
     self.app_status = None
Exemplo n.º 5
0
 def __init__(self, request_id):
     self.request_id = request_id
     self.stdout = InputStream()
     self.stderr = InputStream()
     self.request_status = None
     self.app_status = None