Refactor test files for improved readability and consistency
- Removed unnecessary blank lines and adjusted formatting in test files. - Ensured consistent use of commas in function calls and assertions across various test cases. - Updated import statements for better organization and clarity. - Enhanced mock setups in tests for better isolation and reliability. - Improved assertions to follow a consistent style for better readability.
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
"""Tests for extraction API endpoints."""
|
||||
|
||||
from unittest.mock import AsyncMock, Mock
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from httpx import AsyncClient
|
||||
|
||||
from app.models.user import User
|
||||
|
||||
|
||||
class TestExtractionEndpoints:
|
||||
"""Test extraction API endpoints."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_create_extraction_success(
|
||||
self, test_client: AsyncClient, auth_cookies: dict[str, str]
|
||||
self, test_client: AsyncClient, auth_cookies: dict[str, str],
|
||||
):
|
||||
"""Test successful extraction creation."""
|
||||
# Set cookies on client instance to avoid deprecation warning
|
||||
@@ -50,7 +46,7 @@ class TestExtractionEndpoints:
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_processor_status_admin(
|
||||
self, test_client: AsyncClient, admin_cookies: dict[str, str]
|
||||
self, test_client: AsyncClient, admin_cookies: dict[str, str],
|
||||
):
|
||||
"""Test getting processor status as admin."""
|
||||
# Set cookies on client instance to avoid deprecation warning
|
||||
@@ -66,7 +62,7 @@ class TestExtractionEndpoints:
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_processor_status_non_admin(
|
||||
self, test_client: AsyncClient, auth_cookies: dict[str, str]
|
||||
self, test_client: AsyncClient, auth_cookies: dict[str, str],
|
||||
):
|
||||
"""Test getting processor status as non-admin user."""
|
||||
# Set cookies on client instance to avoid deprecation warning
|
||||
@@ -80,7 +76,7 @@ class TestExtractionEndpoints:
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_user_extractions(
|
||||
self, test_client: AsyncClient, auth_cookies: dict[str, str]
|
||||
self, test_client: AsyncClient, auth_cookies: dict[str, str],
|
||||
):
|
||||
"""Test getting user extractions."""
|
||||
# Set cookies on client instance to avoid deprecation warning
|
||||
|
||||
Reference in New Issue
Block a user