'Test that snapshot list pagination is limited by osapi_max_limit.'

def test_list_snapshots_next_link_default_limit(self):

    (volume, snaps) = self._create_db_snapshots(3)
    CONF.set_default('osapi_max_limit', 2)
    def get_pagination_params(params, max_limit=CONF.osapi_max_limit, original_call=common.get_pagination_params):
        return original_call(params, max_limit)
    def _get_limit_param(params, max_limit=CONF.osapi_max_limit, original_call=common._get_limit_param):
        return original_call(params, max_limit)
    with mock.patch.object(common, 'get_pagination_params', get_pagination_params):
        with mock.patch.object(common, '_get_limit_param', _get_limit_param):
            self._assert_list_next({'marker': [snaps[1].id]})
            self._assert_list_next(marker=snaps[1].id)
