From 3f5b620dc5e15bef0de7e348be16995c3b95f8a4 Mon Sep 17 00:00:00 2001 From: Andrea Piccinelli Date: Wed, 11 Sep 2024 14:49:30 +0200 Subject: [PATCH] Adjusting the unit test scripts --- .../WMCore_t/Storage_t/Backends_t/GFAL2Impl_t.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/python/WMCore_t/Storage_t/Backends_t/GFAL2Impl_t.py b/test/python/WMCore_t/Storage_t/Backends_t/GFAL2Impl_t.py index 9c856611f7..4c71abc8c3 100644 --- a/test/python/WMCore_t/Storage_t/Backends_t/GFAL2Impl_t.py +++ b/test/python/WMCore_t/Storage_t/Backends_t/GFAL2Impl_t.py @@ -112,15 +112,17 @@ def getStageOutCommandResult(self, copyCommandDict, createRemoveFileCommandResul EXIT_STATUS=$? echo "gfal-copy exit status: $EXIT_STATUS" if [[ $EXIT_STATUS != 0 ]]; then - echo "ERROR: gfal-copy exited with $EXIT_STATUS" - echo "Cleaning up failed file:" - %s + echo "ERROR: gfal-copy exited with $EXIT_STATUS" + echo "Cleaning up failed file:" + {remove_command} fi exit $EXIT_STATUS - """ % createRemoveFileCommandResult - + """.format( + remove_command=createRemoveFileCommandResult + ) + return result - + @mock.patch('WMCore.Storage.Backends.GFAL2Impl.os.path') @mock.patch('WMCore.Storage.StageOutImpl.StageOutImpl.executeCommand') def testRemoveFile_isFile(self, mock_executeCommand, mock_path):