File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -342,6 +342,7 @@ def configure_step(self, mapping):
342342 api_options ["update_key" ] = mapping .update_key [0 ]
343343 action = DataOperationType .UPSERT
344344 elif mapping .action == DataOperationType .SELECT :
345+ # Bulk process expects DataOpertionType to be QUERY
345346 action = DataOperationType .QUERY
346347 else :
347348 action = mapping .action
Original file line number Diff line number Diff line change 1+ import pytest
2+
13from cumulusci .tasks .bulkdata .select_utils import (
24 SelectOperationExecutor ,
35 SelectStrategy ,
@@ -215,6 +217,20 @@ def test_calculate_levenshtein_distance():
215217 assert calculate_levenshtein_distance (record1 , record2 ) == 0 # Distance should be 0
216218
217219
220+ def test_calculate_levenshtein_distance_error ():
221+ # Identical records
222+ record1 = ["Tom Cruise" , "24" , "Actor" ]
223+ record2 = [
224+ "Tom Cruise" ,
225+ "24" ,
226+ "Actor" ,
227+ "SomethingElse" ,
228+ ] # Record Length does not match
229+ with pytest .raises (ValueError ) as e :
230+ calculate_levenshtein_distance (record1 , record2 )
231+ assert "Records must have the same number of fields" in str (e .value )
232+
233+
218234def test_find_closest_record ():
219235 # Test case 1: Exact match
220236 load_record = ["Tom Cruise" , "62" , "Actor" ]
You can’t perform that action at this time.
0 commit comments