Skip to content

[test] Use single element tuples #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
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
5 changes: 3 additions & 2 deletions test-services/services/virtual_object_command_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def to_durable_future(ctx: ObjectContext, cmd: AwaitableCommand) -> RestateDurab
elif cmd['type'] == "runThrowTerminalException":
def side_effect(reason):
raise TerminalError(message=reason)
return ctx.run("run should fail command", side_effect, args=(cmd['reason']))
return ctx.run("run should fail command", side_effect, args=(cmd['reason'],))

@virtual_object_command_interpreter.handler(name="interpretCommands")
async def interpret_commands(ctx: ObjectContext, req: InterpretRequest):
Expand All @@ -140,7 +140,8 @@ async def interpret_commands(ctx: ObjectContext, req: InterpretRequest):
reject_awakeable(ctx, cmd)
result = ""
elif cmd['type'] == "getEnvVariable":
result = await ctx.run("get_env", lambda: os.environ.get(cmd['envName'], default=""))
env_name = cmd['envName']
result = await ctx.run("get_env", lambda e=env_name: os.environ.get(e, ""))
elif cmd['type'] == "awaitOne":
awaitable = to_durable_future(ctx, cmd['command'])
# We need this dance because the Python SDK doesn't support .map on futures
Expand Down