aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-19 09:01:48 +0300
committerGravatar ks129 <[email protected]>2020-05-19 09:01:48 +0300
commit1715b2e0461b142009757b04f257cf999779a668 (patch)
treeee6388fdd4a7e976c9a7226f0ef6c1b9ad158ef1 /tests
parentEH Tests: Added test for `try_get_tag` `ctx.invoke` calling (diff)
EH Tests: Added test for `try_get_tag` `ResponseCodeError` ignore
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_error_handler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/bot/cogs/test_error_handler.py b/tests/bot/cogs/test_error_handler.py
index 43092f082..6dda85304 100644
--- a/tests/bot/cogs/test_error_handler.py
+++ b/tests/bot/cogs/test_error_handler.py
@@ -296,6 +296,12 @@ class TryGetTagTests(unittest.IsolatedAsyncioTestCase):
self.assertIsNone(await self.cog.try_get_tag(self.ctx))
self.ctx.invoke.assert_awaited_once_with(self.tag.get_command, tag_name="foo")
+ async def test_try_get_tag_response_code_error_suppress(self):
+ """Should suppress `ResponseCodeError` when calling `ctx.invoke`."""
+ self.ctx.invoked_with = "foo"
+ self.ctx.invoke.side_effect = ResponseCodeError(MagicMock())
+ self.assertIsNone(await self.cog.try_get_tag(self.ctx))
+
class OtherErrorHandlerTests(unittest.IsolatedAsyncioTestCase):
"""Other `ErrorHandler` tests."""