diff options
author | 2020-05-19 09:14:25 +0300 | |
---|---|---|
committer | 2020-05-19 09:14:25 +0300 | |
commit | 98c30a30f24feb227bf7e921e825b7124515d640 (patch) | |
tree | f90fea568097d4108570805e5e2b5f1e3cc24eb3 /tests | |
parent | EH Tests: Added test for `try_get_tag` `ResponseCodeError` ignore (diff) |
EH Tests: Created test for `handle_user_input_error` `get_help_command`
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/cogs/test_error_handler.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/bot/cogs/test_error_handler.py b/tests/bot/cogs/test_error_handler.py index 6dda85304..377fc5228 100644 --- a/tests/bot/cogs/test_error_handler.py +++ b/tests/bot/cogs/test_error_handler.py @@ -303,6 +303,22 @@ class TryGetTagTests(unittest.IsolatedAsyncioTestCase): self.assertIsNone(await self.cog.try_get_tag(self.ctx)) +class UserInputErrorHandlerTests(unittest.IsolatedAsyncioTestCase): + """Tests for `handle_user_input_error`.""" + + def setUp(self): + self.bot = MockBot() + self.ctx = MockContext(bot=self.bot) + self.cog = ErrorHandler(self.bot) + + @patch("bot.cogs.error_handler.ErrorHandler.get_help_command") + async def test_handle_input_error_handler_get_help_command_call(self, get_help_command): + """Should call `ErrorHandler.get_help_command`.""" + get_help_command.return_value = self.ctx.send_help(self.ctx) + await self.cog.handle_user_input_error(self.ctx, errors.UserInputError()) + get_help_command.assert_called_once_with(self.ctx) + + class OtherErrorHandlerTests(unittest.IsolatedAsyncioTestCase): """Other `ErrorHandler` tests.""" |