@@ -109,6 +109,7 @@ def print_return_msg(error_msg):
109109 print (error_msg )
110110 return error_msg
111111
112+
112113def compare_protocols (prot_tree_orig , prot_tree_final ):
113114 # compare the two dictionaries
114115 errors_list = []
@@ -230,11 +231,19 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
230231 error = False
231232 orig_val = getattr (act_props_orig [nm ], key )
232233 final_val = getattr (el , key )
233-
234+
234235 if key == "isVis" :
235- orig_norm = normalize_condition (orig_val ) if orig_val is not None else None
236- final_norm = normalize_condition (final_val ) if final_val is not None else None
237-
236+ orig_norm = (
237+ normalize_condition (orig_val )
238+ if orig_val is not None
239+ else None
240+ )
241+ final_norm = (
242+ normalize_condition (final_val )
243+ if final_val is not None
244+ else None
245+ )
246+
238247 # Case 1: original is True - final can be None or True
239248 if orig_norm is True :
240249 if not (final_norm is None or final_norm is True ):
@@ -256,7 +265,7 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
256265 elif final_val and orig_val is None :
257266 if normalize_condition (final_val ) != False :
258267 error = True
259-
268+
260269 if error :
261270 errors_list .append (
262271 print_return_msg (
@@ -429,4 +438,4 @@ def test_rs2redcap_redcap2rs(tmpdir):
429438 )
430439
431440 assert not errors_list , f"Errors: { errors_list } "
432- print ("No errors, but found warnings: " , warnings_list )
441+ print ("No errors, but found warnings: " , warnings_list )
0 commit comments