Add comprehensive tests for player API endpoints and player service functionality

- Implemented tests for player API endpoints including play, pause, stop, next, previous, seek, set volume, set mode, reload playlist, and get state.
- Added mock player service for testing API interactions.
- Created tests for player service methods including play, pause, stop playback, next, previous, seek, set volume, set mode, and reload playlist.
- Ensured proper handling of success, error, and edge cases in both API and service tests.
- Verified state management and serialization in player state tests.
This commit is contained in:
JSC
2025-07-30 01:22:24 +02:00
parent 5ed19c8f0f
commit 1b0d291ad3
11 changed files with 2291 additions and 98 deletions

View File

@@ -38,6 +38,13 @@ async def get_db() -> AsyncGenerator[AsyncSession, None]:
await session.close()
def get_session_factory():
"""Get a session factory function for services."""
def session_factory():
return AsyncSession(engine)
return session_factory
async def init_db() -> None:
"""Initialize the database and create tables if they do not exist."""
logger = get_logger(__name__)