Skip to content

Commit

Permalink
minor error in docs
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Curcio <[email protected]>
  • Loading branch information
Lorenzo Curcio authored and Lorenzo Curcio committed Dec 3, 2024
1 parent a7b86c7 commit 1a82754
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daprdocs/content/en/python-sdk-docs/python-actor.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ from dapr.actor.runtime.mock_actor import create_mock_actor
class MyActor(Actor, MyActorInterface):
async def save_state(self, data) -> None:
await self._state_manager.set_state('state', data)
await self._state_manager.set_state('mystate', data)
await self._state_manager.save_state()
mock_actor = create_mock_actor(MyActor, "id")
await mock_actor.save_state(5)
assert mockactor._state_manager._mock_state == 5 #True
assert mockactor._state_manager._mock_state['mystate'] == 5 #True
```
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.

Expand Down

0 comments on commit 1a82754

Please sign in to comment.