1313
1414def  test_it_generates_new_json_file_without_matches ():
1515    # Arrange 
16-     to_delete  =  [{"Column" : "customer_id" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
16+     to_delete  =  [
17+         {"Column" : "customer_id" , "MatchIds" : set (["23456" ]), "Type" : "Simple" }
18+     ]
1719    data  =  (
1820        '{"customer_id": "12345", "x": 1.2, "d":"2001-01-01"}\n ' 
1921        '{"customer_id": "23456", "x": 2.3, "d":"2001-01-03"}\n ' 
@@ -32,7 +34,9 @@ def test_it_generates_new_json_file_without_matches():
3234
3335def  test_it_handles_json_with_gzip_compression ():
3436    # Arrange 
35-     to_delete  =  [{"Column" : "customer_id" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
37+     to_delete  =  [
38+         {"Column" : "customer_id" , "MatchIds" : set (["23456" ]), "Type" : "Simple" }
39+     ]
3640    data  =  (
3741        '{"customer_id": "12345", "x": 7, "d":"2001-01-01"}\n ' 
3842        '{"customer_id": "23456", "x": 8, "d":"2001-01-03"}\n ' 
@@ -51,7 +55,9 @@ def test_it_handles_json_with_gzip_compression():
5155
5256def  test_delete_correct_rows_when_missing_newline_at_the_end ():
5357    # Arrange 
54-     to_delete  =  [{"Column" : "customer_id" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
58+     to_delete  =  [
59+         {"Column" : "customer_id" , "MatchIds" : set (["23456" ]), "Type" : "Simple" }
60+     ]
5561    data  =  (
5662        '{"customer_id": "12345", "x": 1.2, "d":"2001-01-01"}\n ' 
5763        '{"customer_id": "23456", "x": 2.3, "d":"2001-01-03"}\n ' 
@@ -71,7 +77,9 @@ def test_delete_correct_rows_when_missing_newline_at_the_end():
7177def  test_delete_correct_rows_containing_newlines_as_content ():
7278    # UNICODE_NEWLINE_SEP = '\u2028' 
7379    # Arrange 
74-     to_delete  =  [{"Column" : "customer_id" , "MatchIds" : ["12345" ], "Type" : "Simple" }]
80+     to_delete  =  [
81+         {"Column" : "customer_id" , "MatchIds" : set (["12345" ]), "Type" : "Simple" }
82+     ]
7583    data  =  (
7684        '{"customer_id": "12345", "d": "foo"}\n ' 
7785        '{"customer_id": "23456", "d": "foo\u2028 \\ nbar"}\n ' 
@@ -90,7 +98,7 @@ def test_delete_correct_rows_containing_newlines_as_content():
9098
9199def  test_delete_correct_rows_from_json_file_with_complex_types ():
92100    # Arrange 
93-     to_delete  =  [{"Column" : "user.id" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
101+     to_delete  =  [{"Column" : "user.id" , "MatchIds" : set ( ["23456" ]) , "Type" : "Simple" }]
94102    data  =  (
95103        '{"user": {"id": "12345", "name": "John"}, "d":["2001-01-01"]}\n ' 
96104        '{"user": {"id": "23456", "name": "Jane"}, "d":[]}\n ' 
@@ -112,7 +120,9 @@ def test_delete_correct_rows_from_json_file_with_composite_types_tuple_col():
112120    to_delete  =  [
113121        {
114122            "Columns" : ["first_name" , "last_name" ],
115-             "MatchIds" : [["John" , "Doe" ], ["Jane" , "Doe" ], ["Mary" , "Doe" ]],
123+             "MatchIds" : set (
124+                 [tuple (["John" , "Doe" ]), tuple (["Jane" , "Doe" ]), tuple (["Mary" , "Doe" ])]
125+             ),
116126            "Type" : "Composite" ,
117127        }
118128    ]
@@ -136,7 +146,7 @@ def test_delete_correct_rows_from_json_file_with_composite_types_single_col():
136146    to_delete  =  [
137147        {
138148            "Columns" : ["last_name" ],
139-             "MatchIds" : [ ["Doe" ]] ,
149+             "MatchIds" : set ([ tuple ( ["Doe" ])]) ,
140150            "Type" : "Composite" ,
141151        }
142152    ]
@@ -160,7 +170,7 @@ def test_delete_correct_rows_from_json_file_with_composite_types_with_nullable_o
160170    to_delete  =  [
161171        {
162172            "Columns" : ["user.name" , "parents.mother" ],
163-             "MatchIds" : [ ["John" , "23456" ]] ,
173+             "MatchIds" : set ([ tuple ( ["John" , "23456" ])]) ,
164174            "Type" : "Composite" ,
165175        }
166176    ]
@@ -189,7 +199,7 @@ def test_delete_correct_rows_from_json_file_with_composite_types_multiple_types(
189199    to_delete  =  [
190200        {
191201            "Columns" : ["age" , "last_name" ],
192-             "MatchIds" : [ [12 , "Doe" ]] ,
202+             "MatchIds" : set ([ tuple ( [12 , "Doe" ])]) ,
193203            "Type" : "Composite" ,
194204        }
195205    ]
@@ -212,10 +222,10 @@ def test_delete_correct_rows_from_json_file_with_composite_types_multiple_types(
212222def  test_delete_correct_rows_from_json_file_with_both_simple_and_composite_types ():
213223    # Arrange 
214224    to_delete  =  [
215-         {"Column" : "customer_id" , "MatchIds" : [12345 ], "Type" : "Simple" },
225+         {"Column" : "customer_id" , "MatchIds" : set ( [12345 ]) , "Type" : "Simple" },
216226        {
217227            "Columns" : ["first_name" , "last_name" ],
218-             "MatchIds" : [ ["Jane" , "Doe" ]] ,
228+             "MatchIds" : set ([ tuple ( ["Jane" , "Doe" ])]) ,
219229            "Type" : "Composite" ,
220230        },
221231    ]
@@ -236,7 +246,9 @@ def test_delete_correct_rows_from_json_file_with_both_simple_and_composite_types
236246
237247def  test_delete_correct_rows_from_json_file_with_nullable_or_undefined_identifiers ():
238248    # Arrange 
239-     to_delete  =  [{"Column" : "parents.mother" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
249+     to_delete  =  [
250+         {"Column" : "parents.mother" , "MatchIds" : set (["23456" ]), "Type" : "Simple" }
251+     ]
240252    data  =  (
241253        '{"user": {"id": "12345", "name": "John"}, "parents": {"mother": "23456"}}\n ' 
242254        '{"user": {"id": "23456", "name": "Jane"}, "parents": {"mother": null}}\n ' 
@@ -259,7 +271,7 @@ def test_delete_correct_rows_from_json_file_with_nullable_or_undefined_identifie
259271
260272def  test_delete_correct_rows_from_json_file_with_lower_cased_column_id ():
261273    # Arrange 
262-     to_delete  =  [{"Column" : "userid" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
274+     to_delete  =  [{"Column" : "userid" , "MatchIds" : set ( ["23456" ]) , "Type" : "Simple" }]
263275    data  =  (
264276        '{"userId": "12345", "fullName": "JohnDoe"}\n ' 
265277        '{"userId": "23456", "fullName": "JaneDoe"}\n ' 
@@ -279,8 +291,8 @@ def test_delete_correct_rows_from_json_file_with_lower_cased_column_id():
279291def  test_delete_correct_rows_from_json_file_with_multiple_identifiers ():
280292    # Arrange 
281293    to_delete  =  [
282-         {"Column" : "user.id" , "MatchIds" : ["23456" ], "Type" : "Simple" },
283-         {"Column" : "mother" , "MatchIds" : ["23456" ], "Type" : "Simple" },
294+         {"Column" : "user.id" , "MatchIds" : set ( ["23456" ]) , "Type" : "Simple" },
295+         {"Column" : "mother" , "MatchIds" : set ( ["23456" ]) , "Type" : "Simple" },
284296    ]
285297    data  =  (
286298        '{"user": {"id": "12345", "name": "John"}, "mother": "23456"}\n ' 
@@ -297,7 +309,9 @@ def test_delete_correct_rows_from_json_file_with_multiple_identifiers():
297309
298310def  test_it_throws_meaningful_error_for_serialization_issues ():
299311    # Arrange 
300-     to_delete  =  [{"Column" : "customer_id" , "MatchIds" : ["23456" ], "Type" : "Simple" }]
312+     to_delete  =  [
313+         {"Column" : "customer_id" , "MatchIds" : set (["23456" ]), "Type" : "Simple" }
314+     ]
301315    data  =  (
302316        '{"customer_id": "12345", "x": 1.2, "d":"2001-01-01"}\n ' 
303317        '{"customer_id": "23456", "x": 2.3, "d":"invalid\n ' 
0 commit comments