aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cogs
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2019-10-14 19:15:07 +0200
committerGravatar Sebastiaan Zeeff <[email protected]>2019-10-14 22:20:20 +0200
commitae0177432e26c5bde66db46cdeb7850a7dddeca0 (patch)
treeb9d33ecd2e250e83a120e209b4d9407496e77993 /tests/cogs
parentMove the `token_remover` cog tests to `unittest`. (diff)
Use `MockBot`.
Diffstat (limited to 'tests/cogs')
-rw-r--r--tests/cogs/test_token_remover.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/cogs/test_token_remover.py b/tests/cogs/test_token_remover.py
index e5d3648de..3738b6d1b 100644
--- a/tests/cogs/test_token_remover.py
+++ b/tests/cogs/test_token_remover.py
@@ -11,7 +11,7 @@ from bot.cogs.token_remover import (
setup as setup_cog,
)
from bot.constants import Channels, Colours, Event, Icons
-from tests.helpers import AsyncMock
+from tests.helpers import AsyncMock, MockBot
class TokenRemoverTests(unittest.TestCase):
@@ -19,7 +19,7 @@ class TokenRemoverTests(unittest.TestCase):
def setUp(self):
"""Adds the cog, a bot, and a message to the instance for usage in tests."""
- self.bot = MagicMock()
+ self.bot = MockBot()
self.bot.get_cog.return_value = MagicMock()
self.bot.get_cog.return_value.send_log_message = AsyncMock()
self.cog = TokenRemover(bot=self.bot)
@@ -130,7 +130,7 @@ class TokenRemoverSetupTests(unittest.TestCase):
def test_setup(self):
"""Setup of the cog should log a message at `INFO` level."""
- bot = MagicMock()
+ bot = MockBot()
with self.assertLogs(logger='bot.cogs.token_remover', level=logging.INFO) as cm:
setup_cog(bot)