mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Added bucket name to task arguments.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
from flask import current_app
|
||||||
from flask import request
|
from flask import request
|
||||||
|
|
||||||
from app import notify_celery
|
from app import notify_celery
|
||||||
@@ -13,6 +14,7 @@ register_errors(letter_job)
|
|||||||
@letter_job.route('/send-letter-jobs', methods=['POST'])
|
@letter_job.route('/send-letter-jobs', methods=['POST'])
|
||||||
def send_letter_jobs():
|
def send_letter_jobs():
|
||||||
job_ids = validate(request.get_json(), letter_job_ids)
|
job_ids = validate(request.get_json(), letter_job_ids)
|
||||||
notify_celery.send_task(name="send_files_to_dvla", args=(job_ids['job_ids'],), queue="process-ftp")
|
notify_celery.send_task(name="send_files_to_dvla", args=(current_app.config.get("DVLA_UPLOAD_BUCKET_NAME"),
|
||||||
|
job_ids['job_ids'],), queue="process-ftp")
|
||||||
|
|
||||||
return "Task created to send files to DVLA"
|
return "Task created to send files to DVLA"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from flask import current_app
|
||||||
from flask import json
|
from flask import json
|
||||||
|
|
||||||
from tests import create_authorization_header
|
from tests import create_authorization_header
|
||||||
@@ -19,7 +20,10 @@ def test_send_letter_jobs(client, mocker):
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.get_data(as_text=True) == "Task created to send files to DVLA"
|
assert response.get_data(as_text=True) == "Task created to send files to DVLA"
|
||||||
|
|
||||||
mock_celery.assert_called_once_with(name="send_files_to_dvla", args=(job_ids['job_ids'],), queue="process-ftp")
|
mock_celery.assert_called_once_with(name="send_files_to_dvla",
|
||||||
|
args=(current_app.config.get("DVLA_UPLOAD_BUCKET_NAME"),
|
||||||
|
job_ids['job_ids'],),
|
||||||
|
queue="process-ftp")
|
||||||
|
|
||||||
|
|
||||||
def test_send_letter_jobs_throws_validation_error(client, mocker):
|
def test_send_letter_jobs_throws_validation_error(client, mocker):
|
||||||
|
|||||||
Reference in New Issue
Block a user