style: apply black and isort formatting across entire codebase
- Standardize quote style (single to double quotes) - Reorder and group imports alphabetically - Fix line breaks and indentation for consistency - Apply PEP 8 formatting standards Also updated Makefile to exclude both venv and .venv from code quality checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
# tests/test_auth_service.py
|
||||
import pytest
|
||||
|
||||
from app.exceptions.auth import (
|
||||
UserAlreadyExistsException,
|
||||
InvalidCredentialsException,
|
||||
UserNotActiveException,
|
||||
)
|
||||
from app.exceptions.auth import (InvalidCredentialsException,
|
||||
UserAlreadyExistsException,
|
||||
UserNotActiveException)
|
||||
from app.exceptions.base import ValidationException
|
||||
from app.services.auth_service import AuthService
|
||||
from models.schema.auth import UserLogin, UserRegister
|
||||
@@ -218,11 +216,14 @@ class TestAuthService:
|
||||
|
||||
def test_create_access_token_failure(self, test_user, monkeypatch):
|
||||
"""Test creating access token handles failures"""
|
||||
|
||||
# Mock the auth_manager to raise an exception
|
||||
def mock_create_token(*args, **kwargs):
|
||||
raise Exception("Token creation failed")
|
||||
|
||||
monkeypatch.setattr(self.service.auth_manager, "create_access_token", mock_create_token)
|
||||
monkeypatch.setattr(
|
||||
self.service.auth_manager, "create_access_token", mock_create_token
|
||||
)
|
||||
|
||||
with pytest.raises(ValidationException) as exc_info:
|
||||
self.service.create_access_token(test_user)
|
||||
@@ -250,11 +251,14 @@ class TestAuthService:
|
||||
|
||||
def test_hash_password_failure(self, monkeypatch):
|
||||
"""Test password hashing handles failures"""
|
||||
|
||||
# Mock the auth_manager to raise an exception
|
||||
def mock_hash_password(*args, **kwargs):
|
||||
raise Exception("Hashing failed")
|
||||
|
||||
monkeypatch.setattr(self.service.auth_manager, "hash_password", mock_hash_password)
|
||||
monkeypatch.setattr(
|
||||
self.service.auth_manager, "hash_password", mock_hash_password
|
||||
)
|
||||
|
||||
with pytest.raises(ValidationException) as exc_info:
|
||||
self.service.hash_password("testpassword")
|
||||
@@ -267,9 +271,7 @@ class TestAuthService:
|
||||
def test_register_user_database_error(self, db_with_error):
|
||||
"""Test user registration handles database errors"""
|
||||
user_data = UserRegister(
|
||||
email="test@example.com",
|
||||
username="testuser",
|
||||
password="password123"
|
||||
email="test@example.com", username="testuser", password="password123"
|
||||
)
|
||||
|
||||
with pytest.raises(ValidationException) as exc_info:
|
||||
|
||||
Reference in New Issue
Block a user