def test_record_task_batch_logic_reindex_only_deleted_records( get_record, create_index_op, mocked_bulk): records = ['000_deleted', 'aaa_deleted', 'bbb_deleted', 'ccc_deleted'] output = batch_reindex(uuids=records) assert create_index_op.call_count == 0 assert output['success'] == 0 assert output['failures'] == []
def test_record_task_batch_logic_check_reindex_records_count( get_record, create_index_op, mocked_bulk): records = ['000', 'aaa', 'bbb', 'ccc'] output = batch_reindex(uuids=records) assert create_index_op.call_count == 4 assert output['success'] == 4 assert output['failures'] == []
def test_record_task_batch_logic_nothing_to_reindex(get_record, create_index_op, mocked_bulk): records = [] output = batch_reindex(uuids=records) assert create_index_op.call_count == 0 assert output['success'] == 0 assert output['failures'] == []
def test_record_task_batch_logic_nothing_to_reindex(get_record, create_index_op, mocked_bulk): records = [] output = batch_reindex(uuids=records) assert create_index_op.call_count == 0 assert output['success'] == 0 assert output['failures'] == []
def test_record_task_batch_logic_reindex_only_deleted_records(get_record, create_index_op, mocked_bulk): records = ['000_deleted', 'aaa_deleted', 'bbb_deleted', 'ccc_deleted'] output = batch_reindex(uuids=records) assert create_index_op.call_count == 0 assert output['success'] == 0 assert output['failures'] == []
def test_record_task_batch_logic_check_reindex_records_count(get_record, create_index_op, mocked_bulk): records = ['000', 'aaa', 'bbb', 'ccc'] output = batch_reindex(uuids=records) assert create_index_op.call_count == 4 assert output['success'] == 4 assert output['failures'] == []