- Reformatted function signatures in `organization_service.py` and `task_service.py` for better alignment. - Updated import statements across multiple files for consistency and organization. - Enhanced test files by improving formatting and ensuring consistent use of async session factories. - Added type hints and improved type safety in various service and test files. - Adjusted `pyproject.toml` to include configuration for isort, mypy, and ruff for better code quality checks. - Cleaned up unused imports and organized existing ones in several test files.
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
"""API tests for task endpoints."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date, datetime, timedelta, timezone
|
||||
|
||||
import pytest
|
||||
from app.models.task import Task
|
||||
from httpx import AsyncClient
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
||||
|
||||
from app.models.task import Task
|
||||
|
||||
from tests.api.v1.task_activity_shared import auth_headers, create_deal, make_token, prepare_scenario
|
||||
from tests.api.v1.task_activity_shared import (
|
||||
auth_headers,
|
||||
create_deal,
|
||||
make_token,
|
||||
prepare_scenario,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_create_task_endpoint_creates_task_and_activity(
|
||||
session_factory: async_sessionmaker[AsyncSession], client: AsyncClient
|
||||
session_factory: async_sessionmaker[AsyncSession],
|
||||
client: AsyncClient,
|
||||
) -> None:
|
||||
scenario = await prepare_scenario(session_factory)
|
||||
token = make_token(scenario.user_id, scenario.user_email)
|
||||
@@ -40,7 +45,8 @@ async def test_create_task_endpoint_creates_task_and_activity(
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_list_tasks_endpoint_filters_by_deal(
|
||||
session_factory: async_sessionmaker[AsyncSession], client: AsyncClient
|
||||
session_factory: async_sessionmaker[AsyncSession],
|
||||
client: AsyncClient,
|
||||
) -> None:
|
||||
scenario = await prepare_scenario(session_factory)
|
||||
token = make_token(scenario.user_id, scenario.user_email)
|
||||
@@ -63,7 +69,7 @@ async def test_list_tasks_endpoint_filters_by_deal(
|
||||
due_date=datetime.now(timezone.utc) + timedelta(days=3),
|
||||
is_done=False,
|
||||
),
|
||||
]
|
||||
],
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user