Skip to content

Commit 915cc06

Browse files
committed
fix test test_is_assemblyai_route
1 parent 8fd60a4 commit 915cc06

File tree

1 file changed

+0
-97
lines changed

1 file changed

+0
-97
lines changed

tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py

-97
Original file line numberDiff line numberDiff line change
@@ -103,103 +103,6 @@ def test_poll_assembly_for_transcript_response(
103103
assert transcript == AssemblyAITranscriptResponse(**mock_transcript_response)
104104

105105

106-
@pytest.fixture
107-
def mock_request():
108-
request = Mock()
109-
request.method = "POST"
110-
request.headers = {}
111-
request.url = httpx.URL("http://test.com/test")
112-
return request
113-
114-
115-
@pytest.fixture
116-
def mock_response():
117-
return Mock()
118-
119-
120-
@pytest.fixture
121-
def mock_user_api_key_dict():
122-
return {"api_key": "test-key"}
123-
124-
125-
@patch("litellm.utils.get_secret")
126-
@patch(
127-
"litellm.proxy.pass_through_endpoints.pass_through_endpoints.create_pass_through_route"
128-
)
129-
@pytest.mark.asyncio()
130-
async def test_assemblyai_proxy_route_basic_post(
131-
mock_create_route,
132-
mock_get_secret,
133-
mock_request,
134-
mock_response,
135-
mock_user_api_key_dict,
136-
):
137-
"""Test basic POST request handling for AssemblyAI proxy route"""
138-
from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (
139-
assemblyai_proxy_route,
140-
)
141-
142-
# Setup mocks
143-
mock_get_secret.return_value = "test-assemblyai-key"
144-
mock_request.json = AsyncMock(return_value={"text": "test"})
145-
mock_endpoint_func = AsyncMock(return_value={"result": "success"})
146-
mock_create_route.return_value = mock_endpoint_func
147-
148-
result = await assemblyai_proxy_route(
149-
endpoint="v2/transcript",
150-
request=mock_request,
151-
fastapi_response=mock_response,
152-
user_api_key_dict=mock_user_api_key_dict,
153-
)
154-
155-
assert result == {"result": "success"}
156-
mock_create_route.assert_called_once_with(
157-
endpoint="v2/transcript",
158-
target="https://api.assemblyai.com/v2/transcript",
159-
custom_headers={"Authorization": "test-assemblyai-key"},
160-
)
161-
162-
163-
@patch("litellm.utils.get_secret")
164-
@patch(
165-
"litellm.proxy.pass_through_endpoints.pass_through_endpoints.create_pass_through_route"
166-
)
167-
@pytest.mark.asyncio()
168-
async def test_assemblyai_proxy_route_get_transcript(
169-
mock_create_route,
170-
mock_get_secret,
171-
mock_request,
172-
mock_response,
173-
mock_user_api_key_dict,
174-
):
175-
"""Test GET request handling for retrieving a specific transcript from AssemblyAI"""
176-
from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (
177-
assemblyai_proxy_route,
178-
)
179-
180-
# Setup mocks
181-
mock_get_secret.return_value = "test-assemblyai-key"
182-
mock_request.method = "GET"
183-
mock_endpoint_func = AsyncMock(
184-
return_value={"id": "test-transcript-id", "status": "completed"}
185-
)
186-
mock_create_route.return_value = mock_endpoint_func
187-
188-
result = await assemblyai_proxy_route(
189-
endpoint="v2/transcript/test-transcript-id",
190-
request=mock_request,
191-
fastapi_response=mock_response,
192-
user_api_key_dict=mock_user_api_key_dict,
193-
)
194-
195-
assert result == {"id": "test-transcript-id", "status": "completed"}
196-
mock_create_route.assert_called_once_with(
197-
endpoint="v2/transcript/test-transcript-id",
198-
target="https://api.assemblyai.com/v2/transcript/test-transcript-id",
199-
custom_headers={"Authorization": "test-assemblyai-key"},
200-
)
201-
202-
203106
def test_is_assemblyai_route():
204107
"""
205108
Test that the is_assemblyai_route method correctly identifies AssemblyAI routes

0 commit comments

Comments
 (0)