Skip to content

Commit 5cb6b89

Browse files
committed
refactor(tests): update tests to new batch processor middleware
1 parent c999f96 commit 5cb6b89

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tests/functional/test_utilities_batch.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from botocore.config import Config
55
from botocore.stub import Stubber
66

7-
from aws_lambda_powertools.utilities.batch import PartialSQSProcessor, partial_sqs_processor
7+
from aws_lambda_powertools.utilities.batch import PartialSQSProcessor, batch_processor
88

99

1010
@pytest.fixture(scope="module")
@@ -50,7 +50,6 @@ def test_partial_sqs_processor_context_with_failure(sqs_event_factory, record_ha
5050
"""
5151
Test processor with one failing record
5252
"""
53-
5453
fail_record = sqs_event_factory("fail")
5554
success_record = sqs_event_factory("success")
5655

@@ -76,7 +75,6 @@ def test_partial_sqs_processor_context_only_success(sqs_event_factory, record_ha
7675
"""
7776
Test processor without failure
7877
"""
79-
8078
first_record = sqs_event_factory("success")
8179
second_record = sqs_event_factory("success")
8280

@@ -95,7 +93,6 @@ def test_partial_sqs_processor_context_multiple_calls(sqs_event_factory, record_
9593
"""
9694
Test processor without failure
9795
"""
98-
9996
first_record = sqs_event_factory("success")
10097
second_record = sqs_event_factory("success")
10198

@@ -110,12 +107,12 @@ def test_partial_sqs_processor_context_multiple_calls(sqs_event_factory, record_
110107
assert partial_processor.success_messages == [first_record]
111108

112109

113-
def test_partial_sqs_processor_middleware_with_default(sqs_event_factory, record_handler, partial_processor):
110+
def test_batch_processor_middleware_with_partial_sqs_processor(sqs_event_factory, record_handler, partial_processor):
114111
"""
115-
Test middleware with default partial processor
112+
Test middleware's integration with PartialSQSProcessor
116113
"""
117114

118-
@partial_sqs_processor(record_handler=record_handler, processor=partial_processor)
115+
@batch_processor(record_handler=record_handler, processor=partial_processor)
119116
def lambda_handler(event, context):
120117
return True
121118

@@ -134,9 +131,9 @@ def lambda_handler(event, context):
134131
assert result is True
135132

136133

137-
def test_partial_sqs_processor_middleware_with_custom(capsys, sqs_event_factory, record_handler, config):
134+
def test_batch_processor_middleware_with_custom_processor(capsys, sqs_event_factory, record_handler, config):
138135
"""
139-
Test middle with custom partial processor
136+
Test middlewares' integration with custom batch processor
140137
"""
141138

142139
class CustomProcessor(PartialSQSProcessor):
@@ -146,7 +143,7 @@ def failure_handler(self, record, exception):
146143

147144
processor = CustomProcessor(config=config)
148145

149-
@partial_sqs_processor(record_handler=record_handler, processor=processor)
146+
@batch_processor(record_handler=record_handler, processor=processor)
150147
def lambda_handler(event, context):
151148
return True
152149

0 commit comments

Comments
 (0)