Skip to content

The agent that grows with you

test: assert omitted attach_to_session stays absent from formatted list output

kshitijk4poor365cbc242be5
diff --git a/tests/tools/test_cronjob_tools.py b/tests/tools/test_cronjob_tools.py
index 199b9fa8bd0..801ae939a39 100644
--- a/tests/tools/test_cronjob_tools.py
+++ b/tests/tools/test_cronjob_tools.py
@@ -553,6 +553,12 @@ class TestRegisteredHandlerForwardsAttachToSession:
stored = get_job(created["job_id"])
assert stored is not None
assert "attach_to_session" not in stored
+ # And the formatted list output must not invent the field either.
+ listed = json.loads(registry.dispatch("cronjob", {"action": "list"}))
+ formatted = next(
+ j for j in listed["jobs"] if j["job_id"] == created["job_id"]
+ )
+ assert "attach_to_session" not in formatted
class TestLocalDeliveryNotice: