diff options
author | 2020-05-18 15:02:46 +0300 | |
---|---|---|
committer | 2020-05-18 15:02:46 +0300 | |
commit | 8eacf9c3070443aa213f50484cf2d7510f768d08 (patch) | |
tree | d4f8fa6b6d0baebee5720ca84c8b5505c750ae50 | |
parent | EH Tests: Added another test for `CommandNotFound` error handling (diff) |
EH Tests: Added test for `UserInputError` handling on handler
-rw-r--r-- | tests/bot/cogs/test_error_handler.py | 9 |
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 16b4e9742..a974b421a 100644 --- a/tests/bot/cogs/test_error_handler.py +++ b/tests/bot/cogs/test_error_handler.py @@ -87,3 +87,12 @@ class ErrorHandlerTests(unittest.IsolatedAsyncioTestCase): cog.try_silence.assert_not_awaited() cog.try_get_tag.assert_not_awaited() self.ctx.send.assert_not_awaited() + + async def test_error_handler_user_input_error(self): + """Should await `ErrorHandler.handle_user_input_error` when error is `UserInputError`.""" + self.ctx.reset_mock() + cog = ErrorHandler(self.bot) + cog.handle_user_input_error = AsyncMock() + 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) |