mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Add s3 method to remove transformed dvla files
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
from app.aws.s3 import get_s3_file
|
||||
from unittest.mock import call
|
||||
|
||||
from flask import current_app
|
||||
|
||||
from app.aws.s3 import get_s3_file, remove_transformed_dvla_file
|
||||
|
||||
|
||||
def test_get_s3_file_makes_correct_call(sample_service, sample_job, mocker):
|
||||
def test_get_s3_file_makes_correct_call(notify_api, mocker):
|
||||
get_s3_mock = mocker.patch('app.aws.s3.get_s3_object')
|
||||
get_s3_file('foo-bucket', 'bar-file.txt')
|
||||
|
||||
@@ -9,3 +13,15 @@ def test_get_s3_file_makes_correct_call(sample_service, sample_job, mocker):
|
||||
'foo-bucket',
|
||||
'bar-file.txt'
|
||||
)
|
||||
|
||||
|
||||
def test_remove_transformed_dvla_file_makes_correct_call(notify_api, mocker):
|
||||
s3_mock = mocker.patch('app.aws.s3.get_s3_object')
|
||||
fake_uuid = '5fbf9799-6b9b-4dbb-9a4e-74a939f3bb49'
|
||||
|
||||
remove_transformed_dvla_file(fake_uuid)
|
||||
|
||||
s3_mock.assert_has_calls([
|
||||
call(current_app.config['DVLA_UPLOAD_BUCKET_NAME'], '{}-dvla-job.text'.format(fake_uuid)),
|
||||
call().delete()
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user