Skip to content

Commit ae141fc

Browse files
committed
feat: add durable_execution_arn to durable context
1 parent 341336c commit ae141fc

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/aws_durable_execution_sdk_python/context.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ def __init__(
186186
info=log_info,
187187
)
188188

189+
@property
190+
def durable_execution_arn(self) -> str:
191+
"""Get the durable execution ARN."""
192+
return self.state.durable_execution_arn
193+
189194
# region factories
190195
@staticmethod
191196
def from_lambda_context(

tests/context_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ def test_durable_context():
4545
assert DurableContext is not None
4646

4747

48+
def test_durable_context_exposes_durable_execution_arn():
49+
"""Test that DurableContext exposes durable_execution_arn property."""
50+
mock_state = Mock(spec=ExecutionState)
51+
mock_state.durable_execution_arn = "test-arn"
52+
53+
context = DurableContext(state=mock_state)
54+
55+
assert context.durable_execution_arn == "test-arn"
56+
57+
4858
# region Callback
4959
def test_callback_init():
5060
"""Test Callback initialization."""

0 commit comments

Comments
 (0)