@@ -109,6 +109,7 @@ def print_return_msg(error_msg):
109
109
print (error_msg )
110
110
return error_msg
111
111
112
+
112
113
def compare_protocols (prot_tree_orig , prot_tree_final ):
113
114
# compare the two dictionaries
114
115
errors_list = []
@@ -230,11 +231,19 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
230
231
error = False
231
232
orig_val = getattr (act_props_orig [nm ], key )
232
233
final_val = getattr (el , key )
233
-
234
+
234
235
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
+
238
247
# Case 1: original is True - final can be None or True
239
248
if orig_norm is True :
240
249
if not (final_norm is None or final_norm is True ):
@@ -256,7 +265,7 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
256
265
elif final_val and orig_val is None :
257
266
if normalize_condition (final_val ) != False :
258
267
error = True
259
-
268
+
260
269
if error :
261
270
errors_list .append (
262
271
print_return_msg (
@@ -429,4 +438,4 @@ def test_rs2redcap_redcap2rs(tmpdir):
429
438
)
430
439
431
440
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