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_async_log_cache_hit_on_callbacks
Ishaan Jaffc7f9be68030b
diff --git a/tests/local_testing/test_caching_handler.py b/tests/local_testing/test_caching_handler.pyindex c969c9d4bea..1006d23df32 100644--- a/tests/local_testing/test_caching_handler.py+++ b/tests/local_testing/test_caching_handler.py@@ -134,6 +134,7 @@ async def test_async_log_cache_hit_on_callbacks():mock_logging_obj = MagicMock()mock_logging_obj.async_success_handler = AsyncMock()mock_logging_obj.success_handler = MagicMock()+ mock_logging_obj.handle_sync_success_callbacks_for_async_calls = MagicMock()cached_result = "Mocked cached result"start_time = datetime.now()@@ -156,14 +157,14 @@ async def test_async_log_cache_hit_on_callbacks():# Assertionsmock_logging_obj.async_success_handler.assert_called_once_with(- cached_result, start_time, end_time, cache_hit+ result=cached_result, start_time=start_time, end_time=end_time, cache_hit=cache_hit)# Wait for the thread to completeawait asyncio.sleep(0.5)- mock_logging_obj.success_handler.assert_called_once_with(- cached_result, start_time, end_time, cache_hit+ mock_logging_obj.handle_sync_success_callbacks_for_async_calls.assert_called_once_with(+ result=cached_result, start_time=start_time, end_time=end_time, cache_hit=cache_hit)