refactor: Improve code readability by formatting query parameters in user endpoints and enhancing error handling in sound playback

This commit is contained in:
JSC
2025-08-19 22:09:50 +02:00
parent a660cc1861
commit 560ccd3f7e
10 changed files with 177 additions and 84 deletions

View File

@@ -204,7 +204,8 @@ class TestAdminUserEndpoints:
) -> None:
"""Test listing users as non-admin user."""
with patch(
"app.core.dependencies.get_current_active_user", return_value=regular_user,
"app.core.dependencies.get_current_active_user",
return_value=regular_user,
):
response = await client.get("/api/v1/admin/users/")
@@ -296,7 +297,8 @@ class TestAdminUserEndpoints:
) as mock_get_by_id,
patch("app.repositories.user.UserRepository.update") as mock_update,
patch(
"app.repositories.plan.PlanRepository.get_by_id", return_value=test_plan,
"app.repositories.plan.PlanRepository.get_by_id",
return_value=test_plan,
),
):
mock_user = type(

View File

@@ -609,7 +609,8 @@ class TestAuthEndpoints:
@pytest.mark.asyncio
async def test_update_profile_unauthenticated(
self, test_client: AsyncClient,
self,
test_client: AsyncClient,
) -> None:
"""Test update profile without authentication."""
response = await test_client.patch(
@@ -645,7 +646,8 @@ class TestAuthEndpoints:
@pytest.mark.asyncio
async def test_change_password_unauthenticated(
self, test_client: AsyncClient,
self,
test_client: AsyncClient,
) -> None:
"""Test change password without authentication."""
response = await test_client.post(
@@ -716,7 +718,8 @@ class TestAuthEndpoints:
@pytest.mark.asyncio
async def test_get_user_providers_unauthenticated(
self, test_client: AsyncClient,
self,
test_client: AsyncClient,
) -> None:
"""Test get user OAuth providers without authentication."""
response = await test_client.get("/api/v1/auth/user-providers")