Skip to content

Commit ca5c520

Browse files
committed
switch name to _validation_errors
1 parent 575ef3e commit ca5c520

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

genie/write_invalid_reasons.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ def write(
3333
errors_synid = center_mapping_df["errorsSynId"][
3434
center_mapping_df["center"] == center
3535
][0]
36-
with open(center + "_errors.txt", "w") as errorfile:
36+
with open(center + "_validation_errors.txt", "w") as errorfile:
3737
if center not in center_errors:
3838
errorfile.write("No errors!")
3939
else:
4040
errorfile.write(center_errors[center])
4141

42-
ent = synapseclient.File(center + "_errors.txt", parentId=errors_synid)
42+
ent = synapseclient.File(center + "_validation_errors.txt", parentId=errors_synid)
4343
syn.store(ent)
44-
os.remove(center + "_errors.txt")
44+
os.remove(center + "_validation_errors.txt")
4545

4646

4747
def _combine_center_file_errors(

tests/test_write_invalid_reasons.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ def _open_side_effect(filename, mode):
100100
)
101101

102102
# assertions: open + writes
103-
m_open.assert_any_call("A_errors.txt", "w")
104-
m_open.assert_any_call("B_errors.txt", "w")
103+
m_open.assert_any_call("A_validation_errors.txt", "w")
104+
m_open.assert_any_call("B_validation_errors.txt", "w")
105105

106-
file_handles["A_errors.txt"].write.assert_called_once_with("A had errors")
107-
file_handles["B_errors.txt"].write.assert_called_once_with("No errors!")
106+
file_handles["A_validation_errors.txt"].write.assert_called_once_with("A had errors")
107+
file_handles["B_validation_errors.txt"].write.assert_called_once_with("No errors!")
108108

109109
# assertions: correct Synapse folder IDs used (parentId)
110-
m_file_cls.assert_any_call("A_errors.txt", parentId="synErrA")
111-
m_file_cls.assert_any_call("B_errors.txt", parentId="synErrB")
110+
m_file_cls.assert_any_call("A_validation_errors.txt", parentId="synErrA")
111+
m_file_cls.assert_any_call("B_validation_errors.txt", parentId="synErrB")
112112

113113
# Synapse store + cleanup
114114
assert syn.store.call_args_list == [mock.call(ent_a), mock.call(ent_b)]
115-
m_remove.assert_any_call("A_errors.txt")
116-
m_remove.assert_any_call("B_errors.txt")
115+
m_remove.assert_any_call("A_validation_errors.txt")
116+
m_remove.assert_any_call("B_validation_errors.txt")

0 commit comments

Comments
 (0)