예제 #1
0
 def dummy_function(data):
     return Response("500", status_code=500)
예제 #2
0
def response():
    return Response({"failed": 400},
                    headers={"Content-Type": "application/json"},
                    status_code=400)
예제 #3
0
파일: test_app.py 프로젝트: anovis/goblet
    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"]
예제 #4
0
파일: test_app.py 프로젝트: anovis/goblet
    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"]
예제 #5
0
 def mock_function_override():
     return Response("200")
예제 #6
0
 def mock_function2():
     return Response("200")