Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Oct 3, 2024
1 parent 97bd33f commit 0042105
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def test_submit(self):
patch.object(test_submission_ws_client, 'get_submission_status', return_value='OPEN'), \
patch('eva_sub_cli.submission_ws.requests.post', return_value=mock_initiate_response) as mock_post, \
patch('eva_sub_cli.submission_ws.requests.put', return_value=mock_uploaded_response) as mock_put, \
patch.object(StudySubmitter, '_upload_submission'), \
patch.object(self.submitter, 'submission_dir', self.test_sub_dir):
patch.object(StudySubmitter, '_upload_submission'):
mocked_auth.token = self.token
self.submitter.sub_config.set(READY_FOR_SUBMISSION_TO_EVA, value=True)
self.submitter.submit()
Expand Down Expand Up @@ -109,10 +108,10 @@ def test_submit_when_already_completed(self):

with patch.object(self.submitter, 'submission_ws_client', test_submission_ws_client), \
patch.object(test_submission_ws_client, 'get_submission_status', return_value='UPLOADED') as mock_get_submission_status, \
patch.object(self.submitter, 'submission_dir', self.test_sub_dir), \
patch.object(self.submitter, '_initiate_submission') as mock_initiate, \
patch.object(self.submitter, '_upload_submission') as mock_upload, \
patch.object(self.submitter, '_complete_submission') as mock_complete:
patch.object(self.submitter, '_complete_submission') as mock_complete, \
patch.object(self.submitter, 'warning') as mock_warning:

self.submitter.sub_config.set(READY_FOR_SUBMISSION_TO_EVA, value=True)
self.submitter.sub_config.set(SUB_CLI_CONFIG_KEY_SUBMISSION_UPLOAD_URL, value='directory to use for upload')
Expand All @@ -121,6 +120,9 @@ def test_submit_when_already_completed(self):
mock_initiate.assert_not_called()
mock_upload.assert_not_called()
mock_complete.assert_not_called()
mock_warning.assert_called_once_with(
f'You requested the submission using {self.test_sub_dir}. This directory contains an already completed '
f'submission. Please create a new submission directory to resubmit.')

def test_sub_config_file_creation(self):
assert is_submission_dir_writable(self.test_sub_dir)
Expand Down

0 comments on commit 0042105

Please sign in to comment.