mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
test(router): cover sync and async OCR capability routes
This commit is contained in:
parent
62f4d0c095
commit
10cbe497fd
1 changed files with 12 additions and 8 deletions
|
|
@ -18,6 +18,9 @@ def test_router_ocr_capability_gate_skips_chat_fallbacks() -> None:
|
|||
enable_pre_call_checks=True,
|
||||
)
|
||||
|
||||
async def ocr(*args, **kwargs):
|
||||
return None
|
||||
|
||||
async def aocr(*args, **kwargs):
|
||||
return None
|
||||
|
||||
|
|
@ -34,11 +37,12 @@ def test_router_ocr_capability_gate_skips_chat_fallbacks() -> None:
|
|||
)
|
||||
assert [deployment["model_info"]["id"] for deployment in chat_deployments] == ["ocr", "chat"]
|
||||
|
||||
ocr_deployments = router._pre_call_checks(
|
||||
model="document-ocr",
|
||||
healthy_deployments=deployments,
|
||||
messages=None,
|
||||
input=None,
|
||||
request_kwargs={"original_function": aocr},
|
||||
)
|
||||
assert [deployment["model_info"]["id"] for deployment in ocr_deployments] == ["ocr"]
|
||||
for ocr_function in (ocr, aocr):
|
||||
ocr_deployments = router._pre_call_checks(
|
||||
model="document-ocr",
|
||||
healthy_deployments=deployments,
|
||||
messages=None,
|
||||
input=None,
|
||||
request_kwargs={"original_function": ocr_function},
|
||||
)
|
||||
assert [deployment["model_info"]["id"] for deployment in ocr_deployments] == ["ocr"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue