

def test_batch_action_creates_parameters_from_items(self):
    self.action_def['request']['params'] = [{
        'target': 'Bucket',
        'source': 'data',
        'path': 'BucketName',
    }, {
        'target': 'Delete.Objects[].Key',
        'source': 'data',
        'path': 'Key',
    }]
    client = mock.Mock()
    item1 = mock.Mock()
    item1.meta = ResourceMeta('test', client=client, data={
        'BucketName': 'bucket',
        'Key': 'item1',
    })
    item2 = mock.Mock()
    item2.meta = ResourceMeta('test', client=client, data={
        'BucketName': 'bucket',
        'Key': 'item2',
    })
    collection = mock.Mock()
    collection.pages.return_value = [[item1, item2]]
    action = BatchAction(self.model)
    action(collection)
    client.get_frobs.assert_called_with(Bucket='bucket', Delete={
        'Objects': [{
            'Key': 'item1',
        }, {
            'Key': 'item2',
        }],
    })

dataset/ETHPy150Open boto/boto3/tests/unit/resources/test_action.py TestBatchActionCall.test_batch_action_creates_parameters_from_items/original