Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Oct 3, 2024
1 parent 5704de1 commit 5baa584
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tests/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def test_orchestrate_validate_submit(self):
patch('eva_sub_cli.orchestrator.WritableConfig') as m_config, \
patch('eva_sub_cli.orchestrator.get_project_title_and_create_vcf_files_mapping') as m_get_project_title_and_create_vcf_files_mapping, \
patch('eva_sub_cli.orchestrator.DockerValidator') as m_docker_validator, \
patch('eva_sub_cli.orchestrator.StudySubmitter') as m_submitter:
patch('eva_sub_cli.orchestrator.StudySubmitter') as m_submitter, \
patch('eva_sub_cli.orchestrator.check_validation_required', return_value=True):
# Empty config
config = WritableConfig()
m_config.return_value = config
Expand Down
7 changes: 3 additions & 4 deletions tests/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def test_submit(self):
mock_initiate_response.json.return_value = {"submissionId": "mock_submission_id",
"uploadUrl": "directory to use for upload"}



mock_uploaded_response = MagicMock()
mock_uploaded_response.status_code = 200

Expand Down Expand Up @@ -80,6 +78,7 @@ def test_submit_with_config(self):
mock_uploaded_response.status_code = 200

assert is_submission_dir_writable(self.test_sub_dir)
assert not os.path.exists(self.config_file)
sub_config = WritableConfig(self.config_file, version='version1.0')
sub_config.set(READY_FOR_SUBMISSION_TO_EVA, value=True)
sub_config.write()
Expand Down Expand Up @@ -116,9 +115,9 @@ def test_submit_when_already_completed(self):
patch.object(self.submitter, '_complete_submission') as mock_complete:

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='https://example.com')
self.submitter.sub_config.set(SUB_CLI_CONFIG_KEY_SUBMISSION_UPLOAD_URL, value='directory to use for upload')
self.submitter.submit()
# No call was made to the end point or the upload
# No call was made to the end point or the upload because the submission status is 'UPLOADED'
mock_initiate.assert_not_called()
mock_upload.assert_not_called()
mock_complete.assert_not_called()
Expand Down

0 comments on commit 5baa584

Please sign in to comment.