def test_add_resource_endpoint_after_registration(self, app, mocker):
    blueprint = Blueprint('test', __name__)
    api = restx.Api(blueprint)
    app.register_blueprint(blueprint)
    view = mocker.Mock(**{'as_view.return_value.__name__': str('test_view')})
    api.add_resource(view, '/foo', endpoint='bar')
    view.as_view.assert_called_with('bar', api)
def test_add_resource_endpoint_after_registration(self, app, mocker):
    blueprint = Blueprint('test', __name__)
    api = restx.Api(blueprint)
    app.register_blueprint(blueprint)
    view = mocker.Mock(**{'as_view.return_value.__name__': str('test_view')})
    api.add_resource(view, '/foo', endpoint='bar')
    view.as_view.assert_called_with('bar', api)