@@ -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 ):
@@ -260,7 +269,7 @@ def compare_protocols(prot_tree_orig, prot_tree_final):
260
269
elif final_val and orig_val is None :
261
270
if normalize_condition (final_val ) != False :
262
271
error = True
263
-
272
+
264
273
if error :
265
274
errors_list .append (
266
275
print_return_msg (
@@ -433,4 +442,4 @@ def test_rs2redcap_redcap2rs(tmpdir):
433
442
)
434
443
435
444
assert not errors_list , f"Errors: { errors_list } "
436
- print ("No errors, but found warnings: " , warnings_list )
445
+ print ("No errors, but found warnings: " , warnings_list )
0 commit comments