fix: resolve mypy type errors in test file
This commit is contained in:
parent
db07994691
commit
0fa42d7fe8
1 changed files with 6 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ from core.shared.testgen_models import TestGenErrorResponseSchema, TestGenSchema
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_request():
|
||||
def mock_request() -> MagicMock:
|
||||
"""Create a mock authenticated request."""
|
||||
request = MagicMock()
|
||||
request.user = "test_user_id"
|
||||
|
|
@ -25,10 +25,10 @@ def mock_request():
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def test_data():
|
||||
def test_data() -> TestGenSchema:
|
||||
"""Create test data for JavaScript testgen."""
|
||||
return TestGenSchema(
|
||||
trace_id="test-trace-id-12345678-1234-1234-1234-123456789012",
|
||||
trace_id="550e8400-e29b-41d4-a716-446655440000",
|
||||
source_code_being_tested="function add(a, b) { return a + b; }",
|
||||
function_to_optimize=FunctionToOptimize(file_path="/test/add.js", function_name="add", parents=[]),
|
||||
module_path="./add",
|
||||
|
|
@ -44,7 +44,7 @@ def test_data():
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_timeout_error_returns_specific_message(mock_request, test_data):
|
||||
async def test_timeout_error_returns_specific_message(mock_request: MagicMock, test_data: TestGenSchema) -> None:
|
||||
"""
|
||||
Test that LLM timeout errors return a specific message, not generic "Internal server error".
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ async def test_timeout_error_returns_specific_message(mock_request, test_data):
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_rate_limit_error_returns_specific_message(mock_request, test_data):
|
||||
async def test_rate_limit_error_returns_specific_message(mock_request: MagicMock, test_data: TestGenSchema) -> None:
|
||||
"""
|
||||
Test that rate limit errors return a specific message.
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ async def test_rate_limit_error_returns_specific_message(mock_request, test_data
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_generic_error_returns_internal_error(mock_request, test_data):
|
||||
async def test_generic_error_returns_internal_error(mock_request: MagicMock, test_data: TestGenSchema) -> None:
|
||||
"""
|
||||
Test that truly unexpected errors still return a generic message (for security).
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue