mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 16:01:15 -05:00
The rstrip was not working for all file names so this changes it to a replace.
This commit is contained in:
@@ -295,14 +295,14 @@ def letter_raise_alert_if_no_ack_file_for_zip():
|
||||
subfolder=today_str + '/zips_sent',
|
||||
suffix='.TXT'):
|
||||
subname = key.split('/')[-1] # strip subfolder in name
|
||||
zip_file_set.add(subname.upper().rstrip('ZIP.TXT'))
|
||||
zip_file_set.add(subname.upper().replace('.ZIP.TXT', ''))
|
||||
|
||||
# get acknowledgement file
|
||||
ack_file_set = set()
|
||||
|
||||
for key in s3.get_list_of_files_by_suffix(bucket_name=current_app.config['DVLA_RESPONSE_BUCKET_NAME'],
|
||||
subfolder='root/dispatch', suffix='.ACK.txt', last_modified=yesterday):
|
||||
ack_file_set.add(key.lstrip('root/dispatch').upper().rstrip('ACK.TXT'))
|
||||
ack_file_set.add(key.lstrip('root/dispatch').upper().replace('.ACK.TXT', ''))
|
||||
|
||||
message = (
|
||||
"Letter ack file does not contain all zip files sent. "
|
||||
|
||||
@@ -57,10 +57,10 @@ def mock_s3_get_list_match(bucket_name, subfolder='', suffix='', last_modified=N
|
||||
|
||||
def mock_s3_get_list_diff(bucket_name, subfolder='', suffix='', last_modified=None):
|
||||
if subfolder == '2018-01-11/zips_sent':
|
||||
return ['NOTIFY.2018-01-11175007.ZIP.TXT', 'NOTIFY.2018-01-11175008.ZIP.TXT', 'NOTIFY.2018-01-11175009.ZIP.TXT',
|
||||
'NOTIFY.2018-01-11175010.ZIP.TXT']
|
||||
return ['NOTIFY.2018-01-11175007p.ZIP.TXT', 'NOTIFY.2018-01-11175008.ZIP.TXT',
|
||||
'NOTIFY.2018-01-11175009.ZIP.TXT', 'NOTIFY.2018-01-11175010.ZIP.TXT']
|
||||
if subfolder == 'root/dispatch':
|
||||
return ['root/disoatch/NOTIFY.2018-01-11175007.ACK.TXT', 'root/disoatch/NOTIFY.2018-01-11175008.ACK.TXT']
|
||||
return ['root/disoatch/NOTIFY.2018-01-11175007p.ACK.TXT', 'root/disoatch/NOTIFY.2018-01-11175008.ACK.TXT']
|
||||
|
||||
|
||||
@freeze_time('2016-10-18T10:00:00')
|
||||
|
||||
Reference in New Issue
Block a user