def METHOD_NAME(
        make_stubber, stub_runner, item_count, error_code, stop_on_method):
    dyn_stubber = make_stubber(dynamo_batching.dynamodb.meta.client)
    movie_table = dynamo_batching.dynamodb.Table('movie-test')
    movie_list = [
        {'year': index, 'title': f'title-{index}'} for index in range(item_count)]
    table_schema = [
        {'name': 'year', 'type': 'N', 'key_type': 'HASH'},
        {'name': 'title', 'type': 'S', 'key_type': 'RANGE'}]
    archive_table_name = f'{movie_table.name}-archive'
    with stub_runner(error_code, stop_on_method) as runner:
        runner.add(
            dyn_stubber.stub_describe_table, movie_table.name, schema=table_schema,
            provisioned_throughput={'ReadCapacityUnits': 10, 'WriteCapacityUnits': 10})
        runner.add(
            dyn_stubber.stub_create_table, archive_table_name, table_schema,
            {'read': 10, 'write': 10})
        runner.add(dyn_stubber.stub_describe_table, archive_table_name)
        runner.add(
            dyn_stubber.stub_batch_write_item, {
                archive_table_name: [{
                    'PutRequest': {'Item': item}} for item in movie_list]},
            error_code='ValidationException')
        runner.add(
            dyn_stubber.stub_batch_write_item, {
                archive_table_name: [{
                    'PutRequest': {'Item': item}} for item in movie_list]})
        runner.add(
            dyn_stubber.stub_batch_write_item, {
                movie_table.name: [{
                    'DeleteRequest': {'Key': item}} for item in movie_list]})
    if error_code is None:
        got_table = dynamo_batching.archive_movies(movie_table, movie_list)
        assert got_table.name == archive_table_name
    else:
        with pytest.raises(ClientError) as exc_info:
            dynamo_batching.archive_movies(movie_table, movie_list)
        assert exc_info.value.response['Error']['Code'] == error_code