コード例 #1
0
ファイル: views_test.py プロジェクト: fangang123/h
    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'}
コード例 #2
0
ファイル: views_test.py プロジェクト: nlisgo/h
    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'}
コード例 #3
0
ファイル: views_test.py プロジェクト: fangang123/h
    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
コード例 #4
0
ファイル: views_test.py プロジェクト: nlisgo/h
    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