Skip to content

Commit

Permalink
Fix coverage tests
Browse files Browse the repository at this point in the history
Signed-off-by: constanca <[email protected]>
  • Loading branch information
constanca-m committed May 7, 2024
1 parent 6e75f68 commit 8356ff2
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/handlers/aws/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ def test_lambda_handler_noop(self) -> None:
with self.subTest("no originalEventSourceARN in messageAttributes"):
ctx = ContextMock()
os.environ["S3_CONFIG_FILE"] = "s3://s3_config_file_bucket/s3_config_file_object_key"
os.environ["SQS_REPLAY_URL"] = "https://sqs.us-east-2.amazonaws.com/123456789012/replay_queue"
os.environ["SQS_CONTINUE_URL"] = "https://sqs.us-east-2.amazonaws.com/123456789012/continue_queue"
lambda_event = deepcopy(_dummy_lambda_event)
del lambda_event["Records"][0]["messageAttributes"]["originalEventSourceARN"]
assert handler(lambda_event, ctx) == "completed" # type:ignore
Expand Down Expand Up @@ -462,20 +464,6 @@ def test_lambda_handler_noop(self) -> None:
del lambda_event["Records"][0]["messageAttributes"]["originalEventSourceARN"]
assert handler(lambda_event, ctx) == "completed" # type:ignore

with self.subTest("no input defined for kinesis-data-stream"):
ctx = ContextMock()
os.environ["S3_CONFIG_FILE"] = "s3://s3_config_file_bucket/s3_config_file_object_key"
lambda_event = {
"Records": [
{
"eventSource": "aws:kinesis",
"kinesis": {"data": ""},
"eventSourceARN": "arn:aws:kinesis:eu-central-1:123456789:stream/test-esf-kinesis-stream",
}
]
}
assert handler(lambda_event, ctx) == "completed" # type:ignore

with self.subTest("body is neither replay queue nor s3-sqs"):
ctx = ContextMock()
os.environ["S3_CONFIG_FILE"] = "s3://s3_config_file_bucket/s3_config_file_object_key"
Expand Down

0 comments on commit 8356ff2

Please sign in to comment.