From cd8ed8bc5793985df2c1692072a932ceee517b95 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 8 Jul 2026 02:13:35 +0200 Subject: OPEN THE RUST GATES Signed-off-by: salmonik --- tests/cogs/test_music_audio.py | 93 ------------------------------------------ 1 file changed, 93 deletions(-) delete mode 100644 tests/cogs/test_music_audio.py (limited to 'tests/cogs/test_music_audio.py') diff --git a/tests/cogs/test_music_audio.py b/tests/cogs/test_music_audio.py deleted file mode 100644 index 98c6f6b..0000000 --- a/tests/cogs/test_music_audio.py +++ /dev/null @@ -1,93 +0,0 @@ -import pytest -from unittest.mock import AsyncMock, patch, MagicMock -import os -from conftest import MockApplicationContext - - -@pytest.mark.asyncio -async def test_validate_voice_channel_not_in_voice(): - from cogs.voice import VoiceManager as AudioPlaybackManager - - mock_ctx = MagicMock() - mock_ctx.author.voice = None - mock_ctx.respond = AsyncMock() - - result = await AudioPlaybackManager.validate_voice_channel(mock_ctx) - - assert result is None - mock_ctx.respond.assert_called_once() - - -@pytest.mark.asyncio -async def test_validate_voice_channel_in_voice(): - from cogs.voice import VoiceManager as AudioPlaybackManager - - mock_channel = MagicMock() - mock_ctx = MagicMock() - mock_ctx.author.voice = MagicMock() - mock_ctx.author.voice.channel = mock_channel - mock_ctx.respond = AsyncMock() - - result = await AudioPlaybackManager.validate_voice_channel(mock_ctx) - - assert result == mock_channel - - -@pytest.mark.asyncio -async def test_prepare_file_source_file_not_found(): - from cogs.voice import VoiceManager as AudioPlaybackManager - - display_name, absolute_path = await AudioPlaybackManager.prepare_file_source("/nonexistent/file.mp3") - - assert display_name is None - assert absolute_path is None - - -@pytest.mark.asyncio -async def test_prepare_file_source_absolute_path(): - from cogs.voice import VoiceManager as AudioPlaybackManager - - with patch('os.path.exists', return_value=True): - with patch('os.path.isabs', return_value=True): - display_name, absolute_path = await AudioPlaybackManager.prepare_file_source("/tmp/test.mp3") - - assert display_name == "test" - assert absolute_path == "/tmp/test.mp3" - - -@pytest.mark.asyncio -async def test_prepare_source_url(): - from cogs.voice import VoiceManager as AudioPlaybackManager - - source, _, is_url = await AudioPlaybackManager.prepare_source("https://example.com/stream") - - assert is_url == True - assert source == "https://example.com/stream" - - -@pytest.mark.asyncio -async def test_prepare_source_local_file(): - 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") - - assert is_url == False - assert display_name == "test" - - -@pytest.mark.asyncio -async def test_cleanup_temp_file(): - from cogs.voice import VoiceManager as AudioPlaybackManager - - with patch('os.path.exists', return_value=True): - with patch('os.remove'): - await AudioPlaybackManager.cleanup_temp_file("/tmp/test.mp3") - - -@pytest.mark.asyncio -async def test_cleanup_temp_file_not_exists(): - 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