diff options
Diffstat (limited to 'tests/cogs/test_downloader_integration.py')
| -rw-r--r-- | tests/cogs/test_downloader_integration.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/cogs/test_downloader_integration.py b/tests/cogs/test_downloader_integration.py deleted file mode 100644 index c7c9790..0000000 --- a/tests/cogs/test_downloader_integration.py +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | import pytest | ||
| 2 | from unittest.mock import MagicMock, AsyncMock, patch | ||
| 3 | |||
| 4 | |||
| 5 | @pytest.fixture | ||
| 6 | def downloader_cog(bot): | ||
| 7 | from cogs.downloader import Downloader | ||
| 8 | cog = Downloader(bot) | ||
| 9 | return cog | ||
| 10 | |||
| 11 | |||
| 12 | @pytest.mark.slow | ||
| 13 | @pytest.mark.asyncio | ||
| 14 | async def test_download_command_flow(downloader_cog, bot): | ||
| 15 | """Test download command with URL processing.""" | ||
| 16 | cog = downloader_cog | ||
| 17 | |||
| 18 | ctx = MagicMock() | ||
| 19 | ctx.author = MagicMock() | ||
| 20 | ctx.guild = MagicMock() | ||
| 21 | ctx.channel = MagicMock() | ||
| 22 | ctx.respond = AsyncMock() | ||
| 23 | ctx.defer = AsyncMock() | ||
| 24 | ctx.followup = AsyncMock() | ||
| 25 | ctx.voice_client = None | ||
| 26 | |||
| 27 | # Mock the download_standalone static method | ||
| 28 | mock_response = { | ||
| 29 | "status": "success", | ||
| 30 | "type": "url", | ||
| 31 | "content": "http://example.com/video.mp4" | ||
| 32 | } | ||
| 33 | |||
| 34 | with patch.object(cog, 'download_standalone', new_callable=AsyncMock, return_value=mock_response): | ||
| 35 | await cog.download.callback(cog, ctx, url="http://youtube.com/test") | ||
| 36 | |||
| 37 | ctx.respond.assert_called_once() | ||
