diff --git a/src/sbl_filing_api/services/submission_processor.py b/src/sbl_filing_api/services/submission_processor.py index b9b552b3..bc3d983f 100644 --- a/src/sbl_filing_api/services/submission_processor.py +++ b/src/sbl_filing_api/services/submission_processor.py @@ -114,8 +114,6 @@ async def validate_and_update_submission( ) upload_to_storage(period_code, lei, str(submission.counter) + REPORT_QUALIFIER, submission_report) - upload_to_storage(period_code, lei, str(submission.counter) + REPORT_QUALIFIER, submission_report) - if not exec_check["continue"]: log.warning(f"Submission {submission.id} is expired, will not be updating final state with results.") return @@ -127,8 +125,7 @@ async def validate_and_update_submission( submission.state = SubmissionState.SUBMISSION_UPLOAD_MALFORMED await update_submission(session, submission) - except Exception as e: - print(f"{e}") + except Exception: log.exception("Validation for submission %d did not complete due to an unexpected error.", submission.id) submission.state = SubmissionState.VALIDATION_ERROR await update_submission(session, submission) diff --git a/tests/services/test_submission_processor.py b/tests/services/test_submission_processor.py index 14c69e37..6dc85237 100644 --- a/tests/services/test_submission_processor.py +++ b/tests/services/test_submission_processor.py @@ -99,7 +99,7 @@ async def test_validate_and_update_successful( "2024", "123456790", mock_sub, None, {"continue": True} ) - assert file_mock.mock_calls[0].args == ( + file_mock.assert_called_once_with( "2024", "123456790", "2" + submission_processor.REPORT_QUALIFIER, @@ -135,7 +135,7 @@ async def test_validate_and_update_warnings( "2024", "123456790", mock_sub, None, {"continue": True} ) - assert file_mock.mock_calls[0].args == ( + file_mock.assert_called_once_with( "2024", "123456790", "3" + submission_processor.REPORT_QUALIFIER, @@ -171,7 +171,7 @@ async def test_validate_and_update_errors( "2024", "123456790", mock_sub, None, {"continue": True} ) - assert file_mock.mock_calls[0].args == ( + file_mock.assert_called_once_with( "2024", "123456790", "4" + submission_processor.REPORT_QUALIFIER,