@@ -44,7 +44,8 @@ async def assertion() -> None:
4444async def test_publish_to_url_async (async_client : AsyncQStash ) -> None :
4545 res = await async_client .message .publish (
4646 body = "test-body" ,
47- url = "https://httpstat.us/200" ,
47+ method = "GET" ,
48+ url = "https://mock.httpstatus.io/200" ,
4849 headers = {
4950 "test-header" : "test-value" ,
5051 },
@@ -60,7 +61,8 @@ async def test_publish_to_url_async(async_client: AsyncQStash) -> None:
6061async def test_publish_to_url_json_async (async_client : AsyncQStash ) -> None :
6162 res = await async_client .message .publish_json (
6263 body = {"ex_key" : "ex_value" },
63- url = "https://httpstat.us/200" ,
64+ method = "GET" ,
65+ url = "https://mock.httpstatus.io/200" ,
6466 headers = {
6567 "test-header" : "test-value" ,
6668 },
@@ -76,13 +78,15 @@ async def test_publish_to_url_json_async(async_client: AsyncQStash) -> None:
7678async def test_disallow_multiple_destinations_async (async_client : AsyncQStash ) -> None :
7779 with pytest .raises (QStashError ):
7880 await async_client .message .publish_json (
79- url = "https://httpstat.us/200" ,
81+ method = "GET" ,
82+ url = "https://mock.httpstatus.io/200" ,
8083 url_group = "test-url-group" ,
8184 )
8285
8386 with pytest .raises (QStashError ):
8487 await async_client .message .publish_json (
85- url = "https://httpstat.us/200" ,
88+ method = "GET" ,
89+ url = "https://mock.httpstatus.io/200" ,
8690 api = {"name" : "llm" , "provider" : openai (OPENAI_API_KEY )},
8791 )
8892
@@ -101,7 +105,8 @@ async def test_batch_async(async_client: AsyncQStash) -> None:
101105 messages .append (
102106 BatchRequest (
103107 body = f"hi { i } " ,
104- url = "https://httpstat.us/200" ,
108+ method = "GET" ,
109+ url = "https://mock.httpstatus.io/200" ,
105110 retries = 0 ,
106111 headers = {
107112 f"test-header-{ i } " : f"test-value-{ i } " ,
@@ -127,7 +132,8 @@ async def test_batch_json_async(async_client: AsyncQStash) -> None:
127132 messages .append (
128133 BatchJsonRequest (
129134 body = {"hi" : i },
130- url = "https://httpstat.us/200" ,
135+ method = "GET" ,
136+ url = "https://mock.httpstatus.io/200" ,
131137 retries = 0 ,
132138 headers = {
133139 f"test-header-{ i } " : f"test-value-{ i } " ,
@@ -157,7 +163,7 @@ async def test_publish_to_api_llm_async(async_client: AsyncQStash) -> None:
157163 }
158164 ],
159165 },
160- callback = "https://httpstat.us /200" ,
166+ callback = "https://mock.httpstatus.io /200" ,
161167 )
162168
163169 assert isinstance (res , PublishResponse )
@@ -181,7 +187,7 @@ async def test_batch_api_llm_async(async_client: AsyncQStash) -> None:
181187 }
182188 ],
183189 },
184- "callback" : "https://httpstat.us /200" ,
190+ "callback" : "https://mock.httpstatus.io /200" ,
185191 },
186192 ]
187193 )
@@ -205,7 +211,8 @@ async def test_enqueue_async(
205211 res = await async_client .message .enqueue (
206212 queue = name ,
207213 body = "test-body" ,
208- url = "https://httpstat.us/200" ,
214+ method = "GET" ,
215+ url = "https://mock.httpstatus.io/200" ,
209216 headers = {
210217 "test-header" : "test-value" ,
211218 },
@@ -227,7 +234,8 @@ async def test_enqueue_json_async(
227234 res = await async_client .message .enqueue_json (
228235 queue = name ,
229236 body = {"test" : "body" },
230- url = "https://httpstat.us/200" ,
237+ method = "GET" ,
238+ url = "https://mock.httpstatus.io/200" ,
231239 headers = {
232240 "test-header" : "test-value" ,
233241 },
@@ -258,7 +266,7 @@ async def test_enqueue_api_llm_async(
258266 ],
259267 },
260268 api = {"name" : "llm" , "provider" : openai (OPENAI_API_KEY )},
261- callback = "https://httpstat.us /200" ,
269+ callback = "https://mock.httpstatus.io /200" ,
262270 )
263271
264272 assert isinstance (res , EnqueueResponse )
@@ -274,8 +282,8 @@ async def test_publish_to_url_group_async(async_client: AsyncQStash) -> None:
274282 await async_client .url_group .upsert_endpoints (
275283 url_group = name ,
276284 endpoints = [
277- {"url" : "https://httpstat.us /200" },
278- {"url" : "https://httpstat.us /201" },
285+ {"url" : "https://mock.httpstatus.io /200" },
286+ {"url" : "https://mock.httpstatus.io /201" },
279287 ],
280288 )
281289
@@ -295,7 +303,8 @@ async def test_publish_to_url_group_async(async_client: AsyncQStash) -> None:
295303async def test_timeout_async (async_client : AsyncQStash ) -> None :
296304 res = await async_client .message .publish_json (
297305 body = {"ex_key" : "ex_value" },
298- url = "https://httpstat.us/200" ,
306+ method = "GET" ,
307+ url = "https://mock.httpstatus.io/200" ,
299308 timeout = 90 ,
300309 )
301310
@@ -364,7 +373,7 @@ async def test_publish_to_api_llm_custom_provider_async(
364373 }
365374 ],
366375 },
367- callback = "https://httpstat.us /200" ,
376+ callback = "https://mock.httpstatus.io /200" ,
368377 )
369378
370379 assert isinstance (res , PublishResponse )
@@ -393,7 +402,7 @@ async def test_enqueue_api_llm_custom_provider_async(
393402 ],
394403 },
395404 api = {"name" : "llm" , "provider" : openai (OPENAI_API_KEY )},
396- callback = "https://httpstat.us /200" ,
405+ callback = "https://mock.httpstatus.io /200" ,
397406 )
398407
399408 assert isinstance (res , EnqueueResponse )
@@ -407,7 +416,7 @@ async def test_publish_with_flow_control_async(
407416) -> None :
408417 result = await async_client .message .publish_json (
409418 body = {"ex_key" : "ex_value" },
410- url = "https://httpstat.us /200?sleep=30000" ,
419+ url = "https://mock.httpstatus.io /200?sleep=30000" ,
411420 flow_control = FlowControl (key = "flow-key" , parallelism = 3 , rate = 4 , period = 2 ),
412421 )
413422
@@ -430,17 +439,17 @@ async def test_batch_with_flow_control_async(
430439 [
431440 BatchJsonRequest (
432441 body = {"ex_key" : "ex_value" },
433- url = "https://httpstat.us /200?sleep=30000" ,
442+ url = "https://mock.httpstatus.io /200?sleep=30000" ,
434443 flow_control = FlowControl (key = "flow-key-1" , rate = 1 ),
435444 ),
436445 BatchJsonRequest (
437446 body = {"ex_key" : "ex_value" },
438- url = "https://httpstat.us /200?sleep=30000" ,
447+ url = "https://mock.httpstatus.io /200?sleep=30000" ,
439448 flow_control = FlowControl (key = "flow-key-2" , rate = 23 , period = "1h30m3s" ),
440449 ),
441450 BatchJsonRequest (
442451 body = {"ex_key" : "ex_value" },
443- url = "https://httpstat.us /200?sleep=30000" ,
452+ url = "https://mock.httpstatus.io /200?sleep=30000" ,
444453 flow_control = FlowControl (key = "flow-key-3" , parallelism = 5 ),
445454 ),
446455 ]
0 commit comments