

@mock.patch('boto3.resources.action.create_request_parameters')
def test_batch_action_calls_operation(self, crp_mock):

    def side_effect(resource, model, params=None, index=None):
        params['foo'] = 'bar'
    crp_mock.side_effect = side_effect
    client = mock.Mock()
    item = mock.Mock()
    crp_mock.meta = ResourceMeta('test', client=client)
    collection = mock.Mock()
    collection.pages.return_value = [[item]]
    model = self.model
    action = BatchAction(model)
    action(collection)
    crp_mock.assert_called_with(item, model.request, params={
        'foo': 'bar',
    }, index=0)
    client.get_frobs.assert_called_with(foo='bar')

dataset/ETHPy150Open boto/boto3/tests/unit/resources/test_action.py TestBatchActionCall.test_batch_action_calls_operation/VarMisuse@69/101 `item`->`crp_mock`