Esempio n. 1
0
 def dummy_function(data):
     return Response("500", status_code=500)
Esempio n. 2
0
def response():
    return Response({"failed": 400},
                    headers={"Content-Type": "application/json"},
                    status_code=400)
Esempio n. 3
0
    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"]
Esempio n. 4
0
    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"]
Esempio n. 5
0
 def mock_function_override():
     return Response("200")
Esempio n. 6
0
 def mock_function2():
     return Response("200")