@@ -116,8 +116,7 @@ def test_long_global_key_validation(client, dataset, image_url):
116116 'error' ] == 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid'
117117
118118
119- def test_global_key_with_whitespaces_validation (client , dataset , image_url ,
120- is_adv_enabled ):
119+ def test_global_key_with_whitespaces_validation (client , dataset , image_url ):
121120 dr_1 = dataset .create_data_row (row_data = image_url )
122121 dr_2 = dataset .create_data_row (row_data = image_url )
123122 dr_3 = dataset .create_data_row (row_data = image_url )
@@ -138,27 +137,19 @@ def test_global_key_with_whitespaces_validation(client, dataset, image_url,
138137 }]
139138 res = client .assign_global_keys_to_data_rows (assignment_inputs )
140139
141- if is_adv_enabled :
142- assert res ['status' ] == 'PARTIAL SUCCESS'
143- assert len (res ['results' ]) == 2
144- assert len (res ['errors' ]) == 1
145- assert res ['errors' ][0 ]['global_key' ] == gk_3
146- assert res ['errors' ][0 ][
147- 'error' ] == "Invalid assignment. Either DataRow does not exist, or globalKey is invalid"
148- else :
149- assert len (res ['results' ]) == 0
150- assert len (res ['errors' ]) == 3
151- assert res ['status' ] == 'FAILURE'
152- assign_errors_ids = set ([e ['data_row_id' ] for e in res ['errors' ]])
153- assign_errors_gks = set ([e ['global_key' ] for e in res ['errors' ]])
154- assign_errors_msgs = set ([e ['error' ] for e in res ['errors' ]])
155- assert assign_errors_ids == set ([dr_1 .uid , dr_2 .uid , dr_3 .uid ])
156- assert assign_errors_gks == set ([gk_1 , gk_2 , gk_3 ])
157- assert assign_errors_msgs == set ([
158- 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid' ,
159- 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid' ,
160- 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid'
161- ])
140+ assert len (res ['results' ]) == 0
141+ assert len (res ['errors' ]) == 3
142+ assert res ['status' ] == 'FAILURE'
143+ assign_errors_ids = set ([e ['data_row_id' ] for e in res ['errors' ]])
144+ assign_errors_gks = set ([e ['global_key' ] for e in res ['errors' ]])
145+ assign_errors_msgs = set ([e ['error' ] for e in res ['errors' ]])
146+ assert assign_errors_ids == set ([dr_1 .uid , dr_2 .uid , dr_3 .uid ])
147+ assert assign_errors_gks == set ([gk_1 , gk_2 , gk_3 ])
148+ assert assign_errors_msgs == set ([
149+ 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid' ,
150+ 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid' ,
151+ 'Invalid assignment. Either DataRow does not exist, or globalKey is invalid'
152+ ])
162153
163154
164155def test_get_data_row_ids_for_global_keys (client , dataset , image_url ):
0 commit comments