Refactor test cases for improved readability and consistency
- Adjusted function signatures in various test files to enhance clarity by aligning parameters. - Updated patching syntax for better readability across test cases. - Improved formatting and spacing in test assertions and mock setups. - Ensured consistent use of async/await patterns in async test functions. - Enhanced comments for better understanding of test intentions.
This commit is contained in:
@@ -35,10 +35,11 @@ async def _is_current_playlist(session: AsyncSession, playlist_id: int) -> bool:
|
||||
|
||||
playlist_repo = PlaylistRepository(session)
|
||||
current_playlist = await playlist_repo.get_current_playlist()
|
||||
return current_playlist is not None and current_playlist.id == playlist_id
|
||||
except Exception: # noqa: BLE001
|
||||
logger.warning("Failed to check if playlist is current", exc_info=True)
|
||||
return False
|
||||
else:
|
||||
return current_playlist is not None and current_playlist.id == playlist_id
|
||||
|
||||
|
||||
class PlaylistService:
|
||||
@@ -199,7 +200,7 @@ class PlaylistService:
|
||||
await self.playlist_repo.delete(playlist)
|
||||
logger.info("Deleted playlist %s for user %s", playlist_id, user_id)
|
||||
|
||||
# If the deleted playlist was current, reload player to use main playlist fallback
|
||||
# If the deleted playlist was current, reload player to use main fallback
|
||||
if was_current:
|
||||
await _reload_player_playlist()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user