Skip to content

Commit 488d5dc

Browse files
affandarCopilot
andcommitted
feat: add untagged-returns-none test for parity with Node SDK
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d1b0a24 commit 488d5dc

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

tests/test_tags.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,35 @@ def test_with_tag_returns_scheduled_task():
208208
assert tagged["tag"] == "gpu"
209209

210210

211+
def test_untagged_activity_returns_none_tag():
212+
"""Schedule an untagged activity (no .with_tag()), verify ctx.tag() is None."""
213+
provider = SqliteProvider.in_memory()
214+
client = Client(provider)
215+
runtime = Runtime(
216+
provider,
217+
PyRuntimeOptions(dispatcher_poll_interval_ms=50),
218+
)
219+
220+
@runtime.register_activity("Plain")
221+
def plain(ctx, input):
222+
return {"tag": ctx.tag()}
223+
224+
@runtime.register_orchestration("NoTagOrch")
225+
def no_tag_orch(ctx, input):
226+
result = yield ctx.schedule_activity("Plain", input)
227+
return result
228+
229+
runtime.start()
230+
try:
231+
instance_id = uid("untagged-none")
232+
client.start_orchestration(instance_id, "NoTagOrch", "x")
233+
result = client.wait_for_orchestration(instance_id, 10_000)
234+
assert result.status == "Completed"
235+
assert result.output["tag"] is None
236+
finally:
237+
runtime.shutdown(100)
238+
239+
211240
# ─── PostgreSQL Tests ──────────────────────────────────────────────
212241

213242

0 commit comments

Comments
 (0)