Skip to content

Commit a8fb12d

Browse files
committed
add missing tests
1 parent aa3c766 commit a8fb12d

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

infrastructure/instance/file_name_processor.tf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ resource "aws_iam_policy" "filenameprocessor_lambda_exec_policy" {
166166
{
167167
"Effect" : "Allow",
168168
"Action" : [
169-
"s3:GetObject",
170-
"s3:PutObject",
171-
"s3:DeleteObject",
172-
"s3:ListBucket"
169+
"s3:PutObject"
173170
],
174171
"Resource" : [
175172
"arn:aws:s3:::nhsd-dspp-core-ref-extended-attributes-gdp",

lambdas/filenameprocessor/src/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
SOURCE_BUCKET_NAME = os.getenv("SOURCE_BUCKET_NAME")
1414

15-
# We have used an internal temporary bucket here and an actual dps bucket will replace this
15+
1616
DPS_DESTINATION_BUCKET_NAME = os.getenv("DPS_BUCKET_NAME")
1717
EXPECTED_SOURCE_BUCKET_ACCOUNT = os.getenv("ACCOUNT_ID")
1818
EXPECTED_DPS_DESTINATION_ACCOUNT = os.getenv("DPS_ACCOUNT_ID")

lambdas/filenameprocessor/tests/test_lambda_handler.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,6 @@ def test_lambda_handler_extended_attributes_success(self, mock_get_redis_client)
270270
mock_redis.hkeys = Mock(return_value=["COVID", *all_vaccine_types_in_this_test_file])
271271
mock_get_redis_client.return_value = mock_redis
272272

273-
# Ensure DPS destination bucket exists in moto so copy succeeds
274-
try:
275-
s3_client.create_bucket(Bucket=BucketNames.DPS_DESTINATION)
276-
except Exception:
277-
pass
278-
279273
# Patch uuid4 (message id), and prevent external copy issues by simulating move
280274
with (
281275
patch("file_name_processor.validate_permissions_for_extended_attributes_files", return_value="X8E5B_COVID"),

lambdas/filenameprocessor/tests/utils_for_tests/mock_environment_variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Sqs:
3737
MOCK_ENVIRONMENT_DICT = {
3838
"SOURCE_BUCKET_NAME": BucketNames.SOURCE,
3939
"ACK_BUCKET_NAME": BucketNames.DESTINATION,
40-
"DPS_BUCKET_NAME": BucketNames.DESTINATION,
40+
"DPS_BUCKET_NAME": BucketNames.DPS_DESTINATION,
4141
"ACCOUNT_ID": MOCK_ACCOUNT_ID,
4242
"DPS_ACCOUNT_ID": MOCK_ACCOUNT_ID,
4343
"QUEUE_URL": "https://sqs.eu-west-2.amazonaws.com/123456789012/imms-batch-file-created-queue.fifo",

0 commit comments

Comments
 (0)