Refactor test cases for improved readability and consistency
- Adjusted function signatures in various test files to enhance clarity by aligning parameters. - Updated patching syntax for better readability across test cases. - Improved formatting and spacing in test assertions and mock setups. - Ensured consistent use of async/await patterns in async test functions. - Enhanced comments for better understanding of test intentions.
This commit is contained in:
@@ -29,7 +29,9 @@ class TestExtractionProcessor:
|
||||
"""Test starting and stopping the processor."""
|
||||
# Mock the _process_queue method to avoid actual processing
|
||||
with patch.object(
|
||||
processor, "_process_queue", new_callable=AsyncMock,
|
||||
processor,
|
||||
"_process_queue",
|
||||
new_callable=AsyncMock,
|
||||
):
|
||||
# Start the processor
|
||||
await processor.start()
|
||||
@@ -229,7 +231,9 @@ class TestExtractionProcessor:
|
||||
"app.services.extraction_processor.AsyncSession",
|
||||
) as mock_session_class,
|
||||
patch.object(
|
||||
processor, "_process_single_extraction", new_callable=AsyncMock,
|
||||
processor,
|
||||
"_process_single_extraction",
|
||||
new_callable=AsyncMock,
|
||||
),
|
||||
patch(
|
||||
"app.services.extraction_processor.ExtractionService",
|
||||
@@ -274,7 +278,9 @@ class TestExtractionProcessor:
|
||||
"app.services.extraction_processor.AsyncSession",
|
||||
) as mock_session_class,
|
||||
patch.object(
|
||||
processor, "_process_single_extraction", new_callable=AsyncMock,
|
||||
processor,
|
||||
"_process_single_extraction",
|
||||
new_callable=AsyncMock,
|
||||
),
|
||||
patch(
|
||||
"app.services.extraction_processor.ExtractionService",
|
||||
|
||||
Reference in New Issue
Block a user