diff options
author | 2020-05-19 12:50:43 +0300 | |
---|---|---|
committer | 2020-05-19 12:50:43 +0300 | |
commit | 658f73170100e826fe47ea9f23178a5d071f3932 (patch) | |
tree | 0d474f2408f79ad3af1c2315b53ef9bea624f9e4 /tests | |
parent | EH Tests: Create tests for `handle_api_error` (diff) |
EH Tests: Create test for `ErrorHandler` `setup` function
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/cogs/test_error_handler.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/bot/cogs/test_error_handler.py b/tests/bot/cogs/test_error_handler.py index 5766727e8..fbe0d58d5 100644 --- a/tests/bot/cogs/test_error_handler.py +++ b/tests/bot/cogs/test_error_handler.py @@ -4,7 +4,7 @@ from unittest.mock import AsyncMock, MagicMock, patch from discord.ext.commands import errors from bot.api import ResponseCodeError -from bot.cogs.error_handler import ErrorHandler +from bot.cogs.error_handler import ErrorHandler, setup from bot.cogs.moderation.silence import Silence from bot.cogs.tags import Tags from bot.decorators import InWhitelistCheckFailure @@ -453,3 +453,13 @@ class OtherErrorHandlerTests(unittest.IsolatedAsyncioTestCase): # Await coroutines to avoid warnings await result await expected + + +class ErrorHandlerSetupTests(unittest.TestCase): + """Tests for `ErrorHandler` `setup` function.""" + + def test_setup(self): + """Should call `bot.add_cog` with `ErrorHandler`.""" + bot = MockBot() + setup(bot) + bot.add_cog.assert_called_once() |