def dummy_function(data): return Response("500", status_code=500)
def response(): return Response({"failed": 400}, headers={"Content-Type": "application/json"}, status_code=400)
def test_status(self): def start_response_status(status, response_headers, exc_info=None): assert status == 401 r = Response("test", status_code=401) assert r({}, start_response_status) == ["test"]
def test_headers(self): def start_response_headers(status, response_headers, exc_info=None): assert response_headers == [("Content-Type", "json")] r = Response("test", {"Content-Type": "json"}) assert r({}, start_response_headers) == ["test"]
def mock_function_override(): return Response("200")
def mock_function2(): return Response("200")