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:
@@ -1,6 +1,5 @@
|
||||
"""Extraction repository for database operations."""
|
||||
|
||||
|
||||
from sqlalchemy import desc
|
||||
from sqlmodel import select
|
||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||
@@ -17,12 +16,15 @@ class ExtractionRepository(BaseRepository[Extraction]):
|
||||
super().__init__(Extraction, session)
|
||||
|
||||
async def get_by_service_and_id(
|
||||
self, service: str, service_id: str,
|
||||
self,
|
||||
service: str,
|
||||
service_id: str,
|
||||
) -> Extraction | None:
|
||||
"""Get an extraction by service and service_id."""
|
||||
result = await self.session.exec(
|
||||
select(Extraction).where(
|
||||
Extraction.service == service, Extraction.service_id == service_id,
|
||||
Extraction.service == service,
|
||||
Extraction.service_id == service_id,
|
||||
),
|
||||
)
|
||||
return result.first()
|
||||
|
||||
Reference in New Issue
Block a user