From 49299465c72f101853227c9acc742e624ef83376 Mon Sep 17 00:00:00 2001 From: rafid saad Date: Mon, 2 Feb 2026 17:34:38 -0800 Subject: [PATCH] add test case --- libs/sdk-py/tests/test_crons_client.py | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libs/sdk-py/tests/test_crons_client.py b/libs/sdk-py/tests/test_crons_client.py index 128727599..9250dca76 100644 --- a/libs/sdk-py/tests/test_crons_client.py +++ b/libs/sdk-py/tests/test_crons_client.py @@ -276,3 +276,30 @@ def test_sync_create_with_end_time(): ) assert result == cron + +def test_sync_create_with_enabled(): + """Test that SyncCronClient.create includes enabled in the payload.""" + cron = _cron_payload() + + def handler(request: httpx.Request) -> httpx.Response: + assert request.method == "POST" + assert request.url.path == "/runs/crons" + + body = json.loads(request.content) + assert body["schedule"] == "0 12 * * *" + assert body["assistant_id"] == "asst_456" + assert body["enabled"] == True + + return httpx.Response(200, json=cron) + + transport = httpx.MockTransport(handler) + with httpx.Client(transport=transport, base_url="https://example.com") as client: + http_client = SyncHttpClient(client) + cron_client = SyncCronClient(http_client) + result = cron_client.create( + assistant_id="asst_456", + schedule="0 12 * * *", + enabled=True, + ) + + assert result == cron