aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-18 19:46:15 +0300
committerGravatar ks129 <[email protected]>2020-05-18 19:46:15 +0300
commitec3b4eefbf3f1e67a0ade32522667fcc397539c5 (patch)
tree17832fc15825e8c5f5a5c8fcc11ffbe9ae7849e9 /tests
parentEH Tests: Created `try_silence` test to check no permission response (diff)
EH Tests: Created `try_silence` test to check no permission with except
Diffstat (limited to 'tests')
-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 941b57ecb..8c51467e5 100644
--- a/tests/bot/cogs/test_error_handler.py
+++ b/tests/bot/cogs/test_error_handler.py
@@ -193,3 +193,11 @@ class TrySilenceTests(unittest.IsolatedAsyncioTestCase):
ctx.invoked_with = "foo"
self.bot.get_command.return_value.can_run = AsyncMock(return_value=False)
self.assertFalse(await cog.try_silence(ctx))
+
+ async def test_try_silence_no_permissions_to_run_command_error(self):
+ """Should return `False` because `CommandError` raised (no permissions)."""
+ cog = ErrorHandler(self.bot)
+ ctx = MockContext(bot=self.bot)
+ ctx.invoked_with = "foo"
+ self.bot.get_command.return_value.can_run = AsyncMock(side_effect=errors.CommandError())
+ self.assertFalse(await cog.try_silence(ctx))