From 95e43df1be6a0d7f4f33d729cfa65a6fb8cbc3a5 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 21 May 2026 16:15:21 +0200 Subject: reqs and test fix Signed-off-by: salmonik --- requirements-dev.txt | 2 +- requirements.txt | 2 +- tests/cogs/test_music_integration.py | 26 ++++++++++++++------------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index abba086..6a6279c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -36,7 +36,7 @@ numpy==2.4.4 packaging==26.1 pillow==12.2.0 propcache==0.4.1 -py-cord @ file:///home/salmon/Documents/botcode/senator-sperma/pycord +py-cord==2.8.0 pycparser==3.0 pycryptodomex==3.23.0 PyNaCl==1.6.2 diff --git a/requirements.txt b/requirements.txt index 81f00ef..d43181f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,7 +33,7 @@ numpy==2.4.4 packaging==26.1 pillow==12.2.0 propcache==0.4.1 -py-cord @ file:///home/salmon/Documents/botcode/senator-sperma/pycord +py-cord==2.8.0 pycparser==3.0 pycryptodomex==3.23.0 PyNaCl==1.6.2 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): ctx.author.voice.channel = MagicMock() ctx.guild = MagicMock() - voice_client = AsyncMock() - ctx.voice_client = voice_client - # Test join - ctx.author.voice.channel.connect = AsyncMock(return_value=voice_client) - with patch.object(ctx, 'respond', new_callable=AsyncMock): - with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): - await join_cog.join.callback(join_cog, ctx) - ctx.author.voice.channel.connect.assert_called_once() + mock_vm = MagicMock() + mock_vm.connect = AsyncMock() + with patch('cogs.music.join.get_voice_manager', return_value=mock_vm): + with patch.object(ctx, 'respond', new_callable=AsyncMock): + with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): + await join_cog.join.callback(join_cog, ctx) + mock_vm.connect.assert_called_once_with(ctx.author.voice.channel) # Test stop - with patch.object(ctx, 'respond', new_callable=AsyncMock): - with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): - await stop_cog.stop.callback(stop_cog, ctx) - voice_client.disconnect.assert_called_once() + mock_vm_stop = MagicMock() + mock_vm_stop.disconnect = AsyncMock() + with patch('cogs.music.stop.get_voice_manager', return_value=mock_vm_stop): + with patch.object(ctx, 'respond', new_callable=AsyncMock): + with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): + await stop_cog.stop.callback(stop_cog, ctx) + mock_vm_stop.disconnect.assert_called_once_with(ctx.guild) -- cgit v1.2.3