mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Tests: Remove start_response method
This commit is contained in:
parent
bd52dcd590
commit
d7255df768
1 changed files with 8 additions and 10 deletions
|
@ -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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue