Skip to content

Commit 7ad1137

Browse files
committed
422 code
Signed-off-by: PeaBrane <[email protected]>
1 parent 77990f4 commit 7ad1137

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

tests/router/common.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,23 +2224,23 @@ async def test_busy_threshold_api():
22242224
f"POST /busy_threshold (large tokens threshold) response: {data}"
22252225
)
22262226

2227-
# Test 9: Invalid active_prefill_tokens_threshold value (should fail validation for < 0)
2228-
logger.info(
2229-
"Testing POST /busy_threshold with invalid active_prefill_tokens_threshold (< 0)"
2230-
)
2231-
async with session.post(
2232-
busy_threshold_url,
2233-
json={"model": model_name, "active_prefill_tokens_threshold": -1.0},
2234-
) as response:
2235-
assert (
2236-
response.status == 400
2237-
), f"Expected 400 for negative active_prefill_tokens_threshold, got {response.status}"
2238-
data = await response.json()
2239-
logger.info(
2240-
f"POST /busy_threshold (invalid tokens) response: {data}"
2241-
)
2227+
# Test 9: Invalid active_prefill_tokens_threshold value (should fail validation for < 0)
2228+
# Note: Returns 422 because -1.0 can't be deserialized into u64 (type validation)
2229+
# vs Test 7 which returns 400 because 1.5 is a valid f64 but fails range validation
2230+
logger.info(
2231+
"Testing POST /busy_threshold with invalid active_prefill_tokens_threshold (< 0)"
2232+
)
2233+
async with session.post(
2234+
busy_threshold_url,
2235+
json={"model": model_name, "active_prefill_tokens_threshold": -1.0},
2236+
) as response:
2237+
assert (
2238+
response.status == 422
2239+
), f"Expected 422 for negative active_prefill_tokens_threshold, got {response.status}"
2240+
data = await response.json()
2241+
logger.info(f"POST /busy_threshold (invalid tokens) response: {data}")
22422242

2243-
logger.info("All busy_threshold endpoint tests passed!")
2243+
logger.info("All busy_threshold endpoint tests passed!")
22442244

22452245
asyncio.run(test_busy_threshold_api())
22462246

0 commit comments

Comments
 (0)