def test_error_routing(self, app, mocker):
    blueprint = Blueprint('test', __name__)
    api = restx.Api(blueprint)
    api.add_resource(HelloWorld, '/hi', endpoint='hello')
    api.add_resource(GoodbyeWorld(404), '/bye', endpoint='bye')
    app.register_blueprint(blueprint)
    with app.test_request_context('/hi', method='POST'):
        assert (api._should_use_fr_error_handler() is True)
        assert (api._has_fr_route() is True)
    with app.test_request_context('/bye'):
        api._should_use_fr_error_handler = mocker.Mock(return_value=False)
        assert (api._has_fr_route() is True)
def test_error_routing(self, app, mocker):
    blueprint = Blueprint('test', __name__)
    api = restx.Api(blueprint)
    api.add_resource(HelloWorld, '/hi', endpoint='hello')
    api.add_resource(GoodbyeWorld(404), '/bye', endpoint='bye')
    app.register_blueprint(blueprint)
    with app.test_request_context('/hi', method='POST'):
        assert (api._should_use_fr_error_handler() is True)
        assert (api._has_fr_route() is True)
    with app.test_request_context('/bye'):
        api._should_use_fr_error_handler = mocker.Mock(return_value=False)
        assert (api._has_fr_route() is True)