Tests: Remove start_response method

This commit is contained in:
Unrud 2018-04-29 23:06:18 +02:00
parent bd52dcd590
commit d7255df768

View File

@ -44,15 +44,13 @@ class BaseTest:
args["wsgi.input"] = BytesIO(data) args["wsgi.input"] = BytesIO(data)
args["CONTENT_LENGTH"] = str(len(data)) args["CONTENT_LENGTH"] = str(len(data))
args["wsgi.errors"] = sys.stderr args["wsgi.errors"] = sys.stderr
self.application._answer = self.application(args, self.start_response) status = headers = None
return ( def start_response(status_, headers_):
int(self.application._status.split()[0]), nonlocal status, headers
dict(self.application._headers), status = status_
self.application._answer[0].decode("utf-8") headers = headers_
if self.application._answer else None) answer = self.application(args, start_response)
def start_response(self, status, headers): return (int(status.split()[0]), dict(headers),
"""Put the response values into the current application.""" answer[0].decode("utf-8") if answer else None)
self.application._status = status
self.application._headers = headers