diff options
Diffstat (limited to '')
| -rw-r--r-- | requirements-dev.txt | 2 | ||||
| -rw-r--r-- | requirements.txt | 2 | ||||
| -rw-r--r-- | 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 | |||
| 36 | packaging==26.1 | 36 | packaging==26.1 |
| 37 | pillow==12.2.0 | 37 | pillow==12.2.0 |
| 38 | propcache==0.4.1 | 38 | propcache==0.4.1 |
| 39 | py-cord @ file:///home/salmon/Documents/botcode/senator-sperma/pycord | 39 | py-cord==2.8.0 |
| 40 | pycparser==3.0 | 40 | pycparser==3.0 |
| 41 | pycryptodomex==3.23.0 | 41 | pycryptodomex==3.23.0 |
| 42 | PyNaCl==1.6.2 | 42 | 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 | |||
| 33 | packaging==26.1 | 33 | packaging==26.1 |
| 34 | pillow==12.2.0 | 34 | pillow==12.2.0 |
| 35 | propcache==0.4.1 | 35 | propcache==0.4.1 |
| 36 | py-cord @ file:///home/salmon/Documents/botcode/senator-sperma/pycord | 36 | py-cord==2.8.0 |
| 37 | pycparser==3.0 | 37 | pycparser==3.0 |
| 38 | pycryptodomex==3.23.0 | 38 | pycryptodomex==3.23.0 |
| 39 | PyNaCl==1.6.2 | 39 | 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): | |||
| 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) | ||
