From bdf93cbc700f6baa55a283300d5bd3d2e958bc69 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 20 May 2026 16:40:28 +0200 Subject: Redirect play_commands imports to cogs.voice, remove audio_playback shim - Update play_commands.py to import get_voice_manager from cogs.voice instead of going through the audio_playback.py re-export shim - Delete the audio_playback.py shim file entirely - Update test_music_audio.py imports to use cogs.voice.VoiceManager - Delete PLAN_VOICE_REFACTOR.md (plan is complete) --- tests/cogs/test_music_audio.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/cogs') diff --git a/tests/cogs/test_music_audio.py b/tests/cogs/test_music_audio.py index 150ad5d..98c6f6b 100644 --- a/tests/cogs/test_music_audio.py +++ b/tests/cogs/test_music_audio.py @@ -6,7 +6,7 @@ from conftest import MockApplicationContext @pytest.mark.asyncio async def test_validate_voice_channel_not_in_voice(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager mock_ctx = MagicMock() mock_ctx.author.voice = None @@ -20,7 +20,7 @@ async def test_validate_voice_channel_not_in_voice(): @pytest.mark.asyncio async def test_validate_voice_channel_in_voice(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager mock_channel = MagicMock() mock_ctx = MagicMock() @@ -35,7 +35,7 @@ async def test_validate_voice_channel_in_voice(): @pytest.mark.asyncio async def test_prepare_file_source_file_not_found(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager display_name, absolute_path = await AudioPlaybackManager.prepare_file_source("/nonexistent/file.mp3") @@ -45,7 +45,7 @@ async def test_prepare_file_source_file_not_found(): @pytest.mark.asyncio async def test_prepare_file_source_absolute_path(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager with patch('os.path.exists', return_value=True): with patch('os.path.isabs', return_value=True): @@ -57,7 +57,7 @@ async def test_prepare_file_source_absolute_path(): @pytest.mark.asyncio async def test_prepare_source_url(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager source, _, is_url = await AudioPlaybackManager.prepare_source("https://example.com/stream") @@ -67,7 +67,7 @@ async def test_prepare_source_url(): @pytest.mark.asyncio async def test_prepare_source_local_file(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager with patch('os.path.exists', return_value=True): source, display_name, is_url = await AudioPlaybackManager.prepare_source("/tmp/test.mp3") @@ -78,7 +78,7 @@ async def test_prepare_source_local_file(): @pytest.mark.asyncio async def test_cleanup_temp_file(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager with patch('os.path.exists', return_value=True): with patch('os.remove'): @@ -87,7 +87,7 @@ async def test_cleanup_temp_file(): @pytest.mark.asyncio async def test_cleanup_temp_file_not_exists(): - from cogs.music.audio_playback import AudioPlaybackManager + from cogs.voice import VoiceManager as AudioPlaybackManager with patch('os.path.exists', return_value=False): await AudioPlaybackManager.cleanup_temp_file("/nonexistent/file.mp3") -- cgit v1.2.3