From b343381fea3eab26e334a1b3bba202d715f9ea2e Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 19 Apr 2026 15:44:33 +0200 Subject: test: improve test assertions and edge cases --- tests/cogs/test_music_join.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/cogs/test_music_join.py') diff --git a/tests/cogs/test_music_join.py b/tests/cogs/test_music_join.py index 5fc66f6..3c7ca6e 100644 --- a/tests/cogs/test_music_join.py +++ b/tests/cogs/test_music_join.py @@ -22,14 +22,14 @@ async def test_join_command_success(join_cog, mock_channel, mock_guild, bot, moc ctx = MockApplicationContext(bot=bot, channel=mock_channel, guild=mock_guild) ctx.user = mock_user ctx.author = mock_user - + mock_voice_channel = MagicMock() mock_voice = MagicMock() mock_voice_channel.connect = AsyncMock(return_value=mock_voice) - + ctx.author.voice = MagicMock() ctx.author.voice.channel = mock_voice_channel - + with patch.object(mock_voice_channel, 'connect', new_callable=AsyncMock, return_value=mock_voice): with patch.object(ctx, 'respond', new_callable=AsyncMock): with patch.object(ctx.interaction, 'delete_original_response', new_callable=AsyncMock): @@ -41,13 +41,13 @@ async def test_stop_command_success(stop_cog, mock_channel, mock_guild, bot, moc ctx = MockApplicationContext(bot=bot, channel=mock_channel, guild=mock_guild) ctx.user = mock_user ctx.author = mock_user - + mock_voice_client = MagicMock() mock_voice_client.disconnect = AsyncMock() ctx.voice_client = mock_voice_client - + 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_voice_client.disconnect.assert_called_once() \ No newline at end of file + + mock_voice_client.disconnect.assert_called_once() -- cgit v1.2.3