Beispiel #1
0
    def test_it_returns_status_object(self, pyramid_request):
        exc = views.APIError("it exploded", status_code=429)

        result = views.error_api(exc, pyramid_request)

        assert result == {'status': 'failure', 'reason': 'it exploded'}
Beispiel #2
0
    def test_it_returns_status_object(self, pyramid_request):
        exc = views.APIError("it exploded", status_code=429)

        result = views.error_api(exc, pyramid_request)

        assert result == {'status': 'failure', 'reason': 'it exploded'}
Beispiel #3
0
    def test_it_sets_status_code_from_error(self, pyramid_request):
        exc = views.APIError("it exploded", status_code=429)

        views.error_api(exc, pyramid_request)

        assert pyramid_request.response.status_code == 429
Beispiel #4
0
    def test_it_sets_status_code_from_error(self, pyramid_request):
        exc = views.APIError("it exploded", status_code=429)

        views.error_api(exc, pyramid_request)

        assert pyramid_request.response.status_code == 429