Refactor(backend): improve formatting in services, repositories & tests
- Consistently format multi-line function headers, exception handling, and repository method calls for readability. - Reorganize misplaced imports across modules (e.g., services & tests) into proper sorted order. - Adjust indentation, line breaks, and spacing inconsistencies in tests and migration files. - Cleanup unnecessary trailing newlines and reorganize `__all__` declarations for consistency.
This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
||||
from app.core.exceptions import NotFoundError
|
||||
from app.models.user_organization import OrganizationRole
|
||||
from app.schemas.organizations import OrganizationCreate, OrganizationUpdate
|
||||
from app.services.organization_service import OrganizationService, organization_service
|
||||
from app.services.organization_service import organization_service
|
||||
|
||||
|
||||
def _make_org_create(name=None, slug=None) -> OrganizationCreate:
|
||||
@@ -50,9 +49,7 @@ class TestGetOrganization:
|
||||
_test_engine, AsyncTestingSessionLocal = async_test_db
|
||||
async with AsyncTestingSessionLocal() as session:
|
||||
with pytest.raises(NotFoundError):
|
||||
await organization_service.get_organization(
|
||||
session, str(uuid.uuid4())
|
||||
)
|
||||
await organization_service.get_organization(session, str(uuid.uuid4()))
|
||||
|
||||
|
||||
class TestCreateOrganization:
|
||||
|
||||
@@ -5,10 +5,9 @@ import uuid
|
||||
from datetime import UTC, datetime, timedelta
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
||||
from app.schemas.sessions import SessionCreate
|
||||
from app.services.session_service import SessionService, session_service
|
||||
from app.services.session_service import session_service
|
||||
|
||||
|
||||
def _make_session_create(user_id, jti=None) -> SessionCreate:
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.core.exceptions import NotFoundError
|
||||
from app.models.user import User
|
||||
from app.schemas.users import UserCreate, UserUpdate
|
||||
from app.services.user_service import UserService, user_service
|
||||
from app.services.user_service import user_service
|
||||
|
||||
|
||||
class TestGetUser:
|
||||
|
||||
Reference in New Issue
Block a user