aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cogs/test_music_integration.py
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-05-21 17:10:23 +0200
committersalmonik <raisersoft@proton.me>2026-05-21 17:10:23 +0200
commit2e614665e0c62fe572b5af53a2a6be1116d66720 (patch)
treedbb48ad5d665a3f3d8c793db30a523264f17bcde /tests/cogs/test_music_integration.py
parentfix naming not resolving things like %20 (diff)
parentFix voice reconnect race: reuse VoiceClient instead of destroying it (diff)
downloadsenator-sperma-2e614665e0c62fe572b5af53a2a6be1116d66720.tar.gz
senator-sperma-2e614665e0c62fe572b5af53a2a6be1116d66720.zip
Merge pull request 'Voice related fixes, alongside simplifying assistant' (#5) from dev into main
Reviewed-on: https://codeberg.org/salmonik/senator-sperma/pulls/5
Diffstat (limited to 'tests/cogs/test_music_integration.py')
-rw-r--r--tests/cogs/test_music_integration.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/cogs/test_music_integration.py b/tests/cogs/test_music_integration.py
index 1c0260a..692e1c1 100644
--- a/tests/cogs/test_music_integration.py
+++ b/tests/cogs/test_music_integration.py
@@ -27,18 +27,20 @@ async def test_music_join_stop(music_cog, bot):
27 ctx.author.voice.channel = MagicMock() 27 ctx.author.voice.channel = MagicMock()
28 ctx.guild = MagicMock() 28 ctx.guild = MagicMock()
29 29
30 voice_client = AsyncMock()
31 ctx.voice_client = voice_client
32
33 # Test join 30 # Test join
34 ctx.author.voice.channel.connect = AsyncMock(return_value=voice_client) 31 mock_vm = MagicMock()
35 with patch.object(ctx, 'respond', new_callable=AsyncMock): 32 mock_vm.connect = AsyncMock()
36 with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): 33 with patch('cogs.music.join.get_voice_manager', return_value=mock_vm):
37 await join_cog.join.callback(join_cog, ctx) 34 with patch.object(ctx, 'respond', new_callable=AsyncMock):
38 ctx.author.voice.channel.connect.assert_called_once() 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)
39 38
40 # Test stop 39 # Test stop
41 with patch.object(ctx, 'respond', new_callable=AsyncMock): 40 mock_vm_stop = MagicMock()
42 with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): 41 mock_vm_stop.disconnect = AsyncMock()
43 await stop_cog.stop.callback(stop_cog, ctx) 42 with patch('cogs.music.stop.get_voice_manager', return_value=mock_vm_stop):
44 voice_client.disconnect.assert_called_once() 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)