Documentation Index
Fetch the complete documentation index at: https://docs.restate.dev/llms.txt
Use this file to discover all available pages before exploring further.
The Python SDK has a testing harness to test your Restate handlers.
This uses Testcontainers to run a Restate Server in a Docker container and provides a client to let you test your Restate handlers.
Setup
Install the package:
pip install restate_sdk[harness]
Testing handlers
If you have a service as follows:
import restate
greeter = restate.Service("greeter")
@greeter.handler()
async def greet(ctx: restate.Context, name: str) -> str:
return f"Hello {name}!"
app = restate.app(services=[greeter])
Then you can test it via:
import restate
with restate.test_harness(app) as harness:
restate_client = harness.ingress_client()
print(restate_client.post("/greeter/greet", json="Alice").json())