fix: Lint fixes of last tests

This commit is contained in:
JSC
2025-08-01 09:30:15 +02:00
parent dc29915fbc
commit fceff92ca1
20 changed files with 326 additions and 313 deletions

View File

@@ -1,4 +1,5 @@
"""Tests for VLC player API endpoints."""
# ruff: noqa: ARG002, PLR2004, E501
from unittest.mock import AsyncMock
@@ -20,7 +21,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test successful sound playback via VLC."""
# Set up mocks
mock_vlc_service = AsyncMock()
@@ -73,7 +74,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test VLC playback when sound is not found."""
# Set up mocks
mock_vlc_service = AsyncMock()
@@ -106,7 +107,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test VLC playback when VLC launch fails."""
# Set up mocks
mock_vlc_service = AsyncMock()
@@ -153,7 +154,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test VLC playback when service raises an exception."""
# Set up mocks
mock_vlc_service = AsyncMock()
@@ -184,7 +185,7 @@ class TestVLCEndpoints:
async def test_play_sound_with_vlc_unauthenticated(
self,
client: AsyncClient,
):
) -> None:
"""Test VLC playback without authentication."""
response = await client.post("/api/v1/sounds/vlc/play/1")
assert response.status_code == 401
@@ -195,7 +196,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test successful stopping of all VLC instances."""
# Set up mock
mock_vlc_service = AsyncMock()
@@ -234,7 +235,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test stopping VLC instances when none are running."""
# Set up mock
mock_vlc_service = AsyncMock()
@@ -268,7 +269,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test stopping VLC instances with partial success."""
# Set up mock
mock_vlc_service = AsyncMock()
@@ -303,7 +304,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test stopping VLC instances when service fails."""
# Set up mock
mock_vlc_service = AsyncMock()
@@ -337,7 +338,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_client: AsyncClient,
authenticated_user: User,
):
) -> None:
"""Test stopping VLC instances when service raises an exception."""
# Set up mock to raise an exception
mock_vlc_service = AsyncMock()
@@ -360,7 +361,7 @@ class TestVLCEndpoints:
async def test_stop_all_vlc_instances_unauthenticated(
self,
client: AsyncClient,
):
) -> None:
"""Test stopping VLC instances without authentication."""
response = await client.post("/api/v1/sounds/vlc/stop-all")
assert response.status_code == 401
@@ -371,7 +372,7 @@ class TestVLCEndpoints:
test_app: FastAPI,
authenticated_admin_client: AsyncClient,
admin_user: User,
):
) -> None:
"""Test VLC endpoints work with admin user."""
# Set up mocks
mock_vlc_service = AsyncMock()