The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(rust_bridge): drop generated OCR route assertions from bridge_route tests
Yujong Lee3de23e7f187d
diff --git a/litellm-rust/crates/python-bridge/src/routes/definition.rs b/litellm-rust/crates/python-bridge/src/routes/definition.rsindex 4c8d98ebe62..f846c7ea1f9 100644--- a/litellm-rust/crates/python-bridge/src/routes/definition.rs+++ b/litellm-rust/crates/python-bridge/src/routes/definition.rs@@ -157,11 +157,6 @@ mod tests {let module = PyModule::new(py, "routes").expect("module should be created");crate::routes::register(&module).expect("routes should register");let routes = [- (- "ocr",- "aocr",- "(model, document, api_key=None, api_base=None, custom_llm_provider=None, extra_headers=None, optional_params=None, input_sources=None, timeout_seconds=None)",- ),("transcription","atranscription",@@ -244,24 +239,22 @@ mod tests {kwargs.set_item("extra_headers", &invalid_headers).expect("kwargs should accept extra_headers");- let document = PyDict::new(py);+ let audio = PyDict::new(py);- for (sync_name, async_name) in [("ocr", "aocr"), ("transcription", "atranscription")] {- let sync_error = module- .getattr(sync_name)- .and_then(|function| function.call(("model", &document), Some(&kwargs)))- .expect_err("sync route should reject non-dict extra_headers");- let async_error = module- .getattr(async_name)- .and_then(|function| function.call(("model", &document), Some(&kwargs)))- .expect_err("async route should reject non-dict extra_headers");-- assert_eq!(- sync_error.to_string(),- "ValueError: extra_headers must be a dict"- );- assert_eq!(async_error.to_string(), sync_error.to_string());- }+ let sync_error = module+ .getattr("transcription")+ .and_then(|function| function.call(("model", &audio), Some(&kwargs)))+ .expect_err("sync route should reject non-dict extra_headers");+ let async_error = module+ .getattr("atranscription")+ .and_then(|function| function.call(("model", &audio), Some(&kwargs)))+ .expect_err("async route should reject non-dict extra_headers");++ assert_eq!(+ sync_error.to_string(),+ "ValueError: extra_headers must be a dict"+ );+ assert_eq!(async_error.to_string(), sync_error.to_string());});}@@ -312,15 +305,13 @@ mod tests {let invalid_payload =PyModule::new(py, "invalid_payload").expect("invalid payload should be created");- for name in ["ocr", "transcription"] {- let error = module- .getattr(name)- .and_then(|function| {- function.call(("model", &invalid_payload), Some(&headers_kwargs))- })- .expect_err("payload should be validated before headers");- assert!(!error.to_string().contains("extra_headers"));- }+ let error = module+ .getattr("transcription")+ .and_then(|function| {+ function.call(("model", &invalid_payload), Some(&headers_kwargs))+ })+ .expect_err("payload should be validated before headers");+ assert!(!error.to_string().contains("extra_headers"));});}