aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-18 15:57:01 +0300
committerGravatar ks129 <[email protected]>2020-05-18 15:57:01 +0300
commitae9766a2cc01ddcc15b4d64568e2cfc67673f138 (patch)
treed4b526c9f3f747e920a0b3f6c02a0017677a18cd
parentEH Tests: Added test for `CheckFailure` handling on handler (diff)
EH Tests: Added test for `CommandOnCooldown` handling on handler
-rw-r--r--tests/bot/cogs/test_error_handler.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/bot/cogs/test_error_handler.py b/tests/bot/cogs/test_error_handler.py
index 1cae8a517..2acca7450 100644
--- a/tests/bot/cogs/test_error_handler.py
+++ b/tests/bot/cogs/test_error_handler.py
@@ -105,3 +105,11 @@ class ErrorHandlerTests(unittest.IsolatedAsyncioTestCase):
error = errors.CheckFailure()
self.assertIsNone(await cog.on_command_error(self.ctx, error))
cog.handle_check_failure.assert_awaited_once_with(self.ctx, error)
+
+ async def test_error_handler_command_on_cooldown(self):
+ """Should send error with `ctx.send` when error is `CommandOnCooldown`."""
+ self.ctx.reset_mock()
+ cog = ErrorHandler(self.bot)
+ error = errors.CommandOnCooldown(10, 9)
+ self.assertIsNone(await cog.on_command_error(self.ctx, error))
+ self.ctx.send.assert_awaited_once_with(error)