Skip to content

Commit 1a82754

Browse files
Lorenzo CurcioLorenzo Curcio
Lorenzo Curcio
authored and
Lorenzo Curcio
committed
minor error in docs
Signed-off-by: Lorenzo Curcio <Lorenzo.curcio@valuecuberesearch.com>
1 parent a7b86c7 commit 1a82754

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

daprdocs/content/en/python-sdk-docs/python-actor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ from dapr.actor.runtime.mock_actor import create_mock_actor
7171
7272
class MyActor(Actor, MyActorInterface):
7373
async def save_state(self, data) -> None:
74-
await self._state_manager.set_state('state', data)
74+
await self._state_manager.set_state('mystate', data)
7575
await self._state_manager.save_state()
7676
7777
mock_actor = create_mock_actor(MyActor, "id")
7878
7979
await mock_actor.save_state(5)
80-
assert mockactor._state_manager._mock_state == 5 #True
80+
assert mockactor._state_manager._mock_state['mystate'] == 5 #True
8181
```
8282
Mock actors are created by passing your actor class and an actor ID (a string) to the create_mock_actor function. This function returns an instance of the actor with many internal methods overridden. Instead of interacting with Dapr for tasks like saving state or managing timers, the mock actor uses in-memory state to simulate these behaviors.
8383

0 commit comments

Comments
 (0)