aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-18 15:51:48 +0300
committerGravatar ks129 <[email protected]>2020-05-18 15:51:48 +0300
commitc050dee853a2fb7432b263cda30becf760310377 (patch)
tree40b0753533a624319ccc9c25ba82b601b49afa1a /tests
parentEH Tests: Added test for `UserInputError` handling on handler (diff)
EH Tests: Added test for `CheckFailure` handling on handler
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_error_handler.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/bot/cogs/test_error_handler.py b/tests/bot/cogs/test_error_handler.py
index a974b421a..1cae8a517 100644
--- a/tests/bot/cogs/test_error_handler.py
+++ b/tests/bot/cogs/test_error_handler.py
@@ -96,3 +96,12 @@ class ErrorHandlerTests(unittest.IsolatedAsyncioTestCase):
error = errors.UserInputError()
self.assertIsNone(await cog.on_command_error(self.ctx, error))
cog.handle_user_input_error.assert_awaited_once_with(self.ctx, error)
+
+ async def test_error_handler_check_failure(self):
+ """Should await `ErrorHandler.handle_check_failure` when error is `CheckFailure`."""
+ self.ctx.reset_mock()
+ cog = ErrorHandler(self.bot)
+ cog.handle_check_failure = AsyncMock()
+ error = errors.CheckFailure()
+ self.assertIsNone(await cog.on_command_error(self.ctx, error))
+ cog.handle_check_failure.assert_awaited_once_with(self.ctx, error)