aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cogs/test_music_integration.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cogs/test_music_integration.py')
-rw-r--r--tests/cogs/test_music_integration.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/cogs/test_music_integration.py b/tests/cogs/test_music_integration.py
deleted file mode 100644
index 692e1c1..0000000
--- a/tests/cogs/test_music_integration.py
+++ /dev/null
@@ -1,46 +0,0 @@
1import pytest
2from unittest.mock import MagicMock, AsyncMock, patch, PropertyMock
3import sys
4sys.path.insert(0, '/home/salmon/Documents/botcode/senator-sperma/tests')
5from conftest import MockApplicationContext
6
7
8@pytest.fixture
9def music_cog(bot):
10 from cogs.music.play_commands import PlayCommands
11 cog = PlayCommands(bot)
12 return cog
13
14
15@pytest.mark.slow
16@pytest.mark.asyncio
17async def test_music_join_stop(music_cog, bot):
18 """Test music join and stop commands."""
19 from cogs.music.join import Join
20 from cogs.music.stop import Stop
21
22 join_cog = Join(bot)
23 stop_cog = Stop(bot)
24
25 ctx = MockApplicationContext(bot=bot)
26 ctx.author.voice = MagicMock()
27 ctx.author.voice.channel = MagicMock()
28 ctx.guild = MagicMock()
29
30 # Test join
31 mock_vm = MagicMock()
32 mock_vm.connect = AsyncMock()
33 with patch('cogs.music.join.get_voice_manager', return_value=mock_vm):
34 with patch.object(ctx, 'respond', new_callable=AsyncMock):
35 with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock):
36 await join_cog.join.callback(join_cog, ctx)
37 mock_vm.connect.assert_called_once_with(ctx.author.voice.channel)
38
39 # Test stop
40 mock_vm_stop = MagicMock()
41 mock_vm_stop.disconnect = AsyncMock()
42 with patch('cogs.music.stop.get_voice_manager', return_value=mock_vm_stop):
43 with patch.object(ctx, 'respond', new_callable=AsyncMock):
44 with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock):
45 await stop_cog.stop.callback(stop_cog, ctx)
46 mock_vm_stop.disconnect.assert_called_once_with(ctx.guild)