aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-18 19:20:55 +0300
committerGravatar ks129 <[email protected]>2020-05-18 19:20:55 +0300
commitc1ac5c00d211eda081aec948fe74a6a083854e49 (patch)
tree574d639efa7f334b13e1964ab08728fc61de03a2 /tests
parentEH Tests: Created first test for `try_silence` (diff)
EH Tests: Created `try_silence` test for `get_command`
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 f409cf6bc..90f4c64a6 100644
--- a/tests/bot/cogs/test_error_handler.py
+++ b/tests/bot/cogs/test_error_handler.py
@@ -177,3 +177,12 @@ class TrySilenceTests(unittest.IsolatedAsyncioTestCase):
await cog.try_silence(ctx)
self.assertTrue(hasattr(ctx, "invoked_from_error_handler"))
self.assertTrue(ctx.invoked_from_error_handler)
+
+ async def test_try_silence_get_command(self):
+ """Should call `get_command` with `silence`."""
+ cog = ErrorHandler(self.bot)
+ ctx = MockContext(bot=self.bot)
+ ctx.invoked_with = "foo"
+ self.bot.get_command.return_value = Silence(self.bot).silence
+ await cog.try_silence(ctx)
+ self.bot.get_command.assert_called_once_with("silence")