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_say.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/cogs/test_say.py') diff --git a/tests/cogs/test_say.py b/tests/cogs/test_say.py index 12f2d2a..13cad40 100644 --- a/tests/cogs/test_say.py +++ b/tests/cogs/test_say.py @@ -13,7 +13,7 @@ def say_cog(bot): @pytest.mark.asyncio async def test_say_command(say_cog, mock_channel, mock_guild, bot): ctx = MockApplicationContext(bot=bot, channel=mock_channel, guild=mock_guild) - + with patch.object(ctx, 'send', new_callable=AsyncMock) as mock_send: await say_cog.say.callback(say_cog, ctx, "Hello World") mock_send.assert_called_once_with(content="Hello World") @@ -22,7 +22,7 @@ async def test_say_command(say_cog, mock_channel, mock_guild, bot): @pytest.mark.asyncio async def test_say_command_empty_text(say_cog, mock_channel, mock_guild, bot): ctx = MockApplicationContext(bot=bot, channel=mock_channel, guild=mock_guild) - + with patch.object(ctx, 'send', new_callable=AsyncMock) as mock_send: await say_cog.say.callback(say_cog, ctx, "") mock_send.assert_called_once_with(content="") @@ -32,7 +32,7 @@ async def test_say_command_empty_text(say_cog, mock_channel, mock_guild, bot): async def test_say_command_long_text(say_cog, mock_channel, mock_guild, bot): ctx = MockApplicationContext(bot=bot, channel=mock_channel, guild=mock_guild) long_text = "A" * 2000 - + with patch.object(ctx, 'send', new_callable=AsyncMock) as mock_send: await say_cog.say.callback(say_cog, ctx, long_text) - mock_send.assert_called_once_with(content=long_text) \ No newline at end of file + mock_send.assert_called_once_with(content=long_text) -- cgit v1.2.3