Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/aws_durable_execution_sdk_python/lambda_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,6 @@ def get_execution_state(
max_items: int = 1000,
) -> StateOutput: ... # pragma: no cover

def stop(
self, execution_arn: str, payload: bytes | None
) -> datetime.datetime: ... # pragma: no cover


class LambdaClient(DurableServiceClient):
"""Persist durable operations to the Lambda Durable Function APIs."""
Expand Down Expand Up @@ -984,13 +980,5 @@ def get_execution_state(
)
return StateOutput.from_dict(result)

def stop(self, execution_arn: str, payload: bytes | None) -> datetime.datetime:
result: MutableMapping[str, Any] = self.client.stop_durable_execution(
ExecutionArn=execution_arn, Payload=payload
)

# presumably lambda throws if execution_arn not found? this line will throw if stopDate isn't in response
return result["StopDate"]


# endregion client
28 changes: 0 additions & 28 deletions tests/lambda_service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1897,22 +1897,6 @@ def test_lambda_client_get_execution_state():
assert len(result.operations) == 1


def test_lambda_client_stop():
"""Test LambdaClient.stop method."""
mock_client = Mock()
mock_client.stop_durable_execution.return_value = {
"StopDate": "2023-01-01T00:00:00Z"
}

lambda_client = LambdaClient(mock_client)
result = lambda_client.stop("arn:test", b"payload")

mock_client.stop_durable_execution.assert_called_once_with(
ExecutionArn="arn:test", Payload=b"payload"
)
assert result == "2023-01-01T00:00:00Z"


def test_durable_service_client_protocol_get_execution_state():
"""Test DurableServiceClient protocol get_execution_state method signature."""
mock_client = Mock(spec=DurableServiceClient)
Expand All @@ -1927,18 +1911,6 @@ def test_durable_service_client_protocol_get_execution_state():
assert result == mock_output


def test_durable_service_client_protocol_stop():
"""Test DurableServiceClient protocol stop method signature."""
mock_client = Mock(spec=DurableServiceClient)
stop_time = datetime.datetime(2023, 1, 1, 12, 0, 0, tzinfo=datetime.UTC)
mock_client.stop.return_value = stop_time

result = mock_client.stop("arn:test", b"payload")

mock_client.stop.assert_called_once_with("arn:test", b"payload")
assert result == stop_time


@patch("aws_durable_execution_sdk_python.lambda_service.boto3")
def test_lambda_client_initialize_local_runner_client_defaults(mock_boto3):
"""Test LambdaClient.initialize_local_runner_client with default environment values."""
Expand Down