import pytest from unittest.mock import MagicMock, AsyncMock, patch @pytest.fixture def downloader_cog(bot): from cogs.downloader import Downloader cog = Downloader(bot) return cog @pytest.mark.slow @pytest.mark.asyncio async def test_download_command_flow(downloader_cog, bot): """Test download command with URL processing.""" cog = downloader_cog ctx = MagicMock() ctx.author = MagicMock() ctx.guild = MagicMock() ctx.channel = MagicMock() ctx.respond = AsyncMock() ctx.defer = AsyncMock() ctx.followup = AsyncMock() ctx.voice_client = None # Mock the download_standalone static method mock_response = { "status": "success", "type": "url", "content": "http://example.com/video.mp4" } with patch.object(cog, 'download_standalone', new_callable=AsyncMock, return_value=mock_response): await cog.download.callback(cog, ctx, url="http://youtube.com/test") ctx.respond.assert_called_once()