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:
@@ -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__)
|
||||
|
||||
Reference in New Issue
Block a user