Skip to content

Commit 4e0c121

Browse files
chore: remove internal lambda client
1 parent d641483 commit 4e0c121

File tree

5 files changed

+14
-26
lines changed

5 files changed

+14
-26
lines changed

src/aws_durable_execution_sdk_python_testing/invoker.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ def __init__(self, lambda_client: Any) -> None:
136136
def create(endpoint_url: str, region_name: str) -> LambdaInvoker:
137137
"""Create with the boto lambda client."""
138138
invoker = LambdaInvoker(
139-
boto3.client(
140-
"lambda", endpoint_url=endpoint_url, region_name=region_name
141-
)
139+
boto3.client("lambda", endpoint_url=endpoint_url, region_name=region_name)
142140
)
143141
invoker._current_endpoint = endpoint_url
144142
invoker._endpoint_clients[endpoint_url] = invoker.lambda_client

src/aws_durable_execution_sdk_python_testing/runner.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,7 @@ def wait_for_callback(
698698

699699
# Timeout reached
700700
elapsed = time.time() - start_time
701-
msg = (
702-
f"Callback did not available within {timeout}s "
703-
f"(elapsed: {elapsed:.1f}s."
704-
)
701+
msg = f"Callback did not available within {timeout}s (elapsed: {elapsed:.1f}s."
705702
raise TimeoutError(msg)
706703

707704

@@ -1143,10 +1140,7 @@ def wait_for_callback(
11431140

11441141
# Timeout reached
11451142
elapsed = time.time() - start_time
1146-
msg = (
1147-
f"Callback did not available within {timeout}s "
1148-
f"(elapsed: {elapsed:.1f}s."
1149-
)
1143+
msg = f"Callback did not available within {timeout}s (elapsed: {elapsed:.1f}s."
11501144
raise TimeoutError(msg)
11511145

11521146
def _fetch_execution_history(

tests/web/handlers_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,9 +2381,9 @@ def test_handler_naming_matches_smithy_operations():
23812381
for handler_name in handler_names:
23822382
assert hasattr(handlers, handler_name), f"Handler {handler_name} not found"
23832383
handler_class = getattr(handlers, handler_name)
2384-
assert issubclass(
2385-
handler_class, EndpointHandler
2386-
), f"{handler_name} should inherit from EndpointHandler"
2384+
assert issubclass(handler_class, EndpointHandler), (
2385+
f"{handler_name} should inherit from EndpointHandler"
2386+
)
23872387

23882388

23892389
def test_all_handlers_have_executor():
@@ -2408,9 +2408,9 @@ def test_all_handlers_have_executor():
24082408

24092409
for handler_class in handlers_to_test:
24102410
handler = handler_class(executor)
2411-
assert (
2412-
handler.executor == executor
2413-
), f"{handler_class.__name__} should store executor reference"
2411+
assert handler.executor == executor, (
2412+
f"{handler_class.__name__} should store executor reference"
2413+
)
24142414

24152415

24162416
class MockExceptionHandler(EndpointHandler):

tests/web/routes_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,9 @@ def test_router_constructor_with_all_default_route_types():
919919

920920
for path, method, expected_type in test_cases:
921921
route = router.find_route(path, method)
922-
assert isinstance(
923-
route, expected_type
924-
), f"Expected {expected_type.__name__} for {method} {path}"
922+
assert isinstance(route, expected_type), (
923+
f"Expected {expected_type.__name__} for {method} {path}"
924+
)
925925

926926

927927
def test_router_constructor_with_subset_of_route_types():

tests/web/serialization_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ def test_aws_rest_json_serializer_should_create_serializer_with_boto_components(
8484
assert serialized_data == b'{"test": "value"}'
8585

8686
# Verify boto setup calls
87-
mock_loader.load_service_model.assert_called_once_with(
88-
"lambda", "service-2"
89-
)
87+
mock_loader.load_service_model.assert_called_once_with("lambda", "service-2")
9088
mock_service_model_class.assert_called_once_with(mock_raw_model)
9189
mock_create_serializer.assert_called_once_with("rest-json", include_validation=True)
9290
mock_service_model.operation_model.assert_called_once_with(operation_name)
@@ -270,9 +268,7 @@ def test_aws_rest_json_deserializer_should_create_deserializer_with_boto_compone
270268
assert deserialized_data == {"test": "value"}
271269

272270
# Verify boto setup calls
273-
mock_loader.load_service_model.assert_called_once_with(
274-
"lambda", "service-2"
275-
)
271+
mock_loader.load_service_model.assert_called_once_with("lambda", "service-2")
276272
mock_service_model_class.assert_called_once_with(mock_raw_model)
277273
mock_create_parser.assert_called_once_with("rest-json")
278274
mock_service_model.operation_model.assert_called_once_with(operation_name)

0 commit comments

Comments
 (0)