From 612994ae248e614a9f1712337e0eb7942e0c5f32 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 13 Oct 2019 17:15:32 +0200 Subject: Use `MockBot` and `MockContext`. --- tests/cogs/test_security.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/cogs/test_security.py') diff --git a/tests/cogs/test_security.py b/tests/cogs/test_security.py index 6c646ae70..efa7a50b1 100644 --- a/tests/cogs/test_security.py +++ b/tests/cogs/test_security.py @@ -5,6 +5,7 @@ from unittest.mock import MagicMock from discord.ext.commands import NoPrivateMessage from bot.cogs import security +from tests.helpers import MockBot, MockContext class SecurityCogTests(unittest.TestCase): @@ -12,10 +13,9 @@ class SecurityCogTests(unittest.TestCase): def setUp(self): """Attach an instance of the cog to the class for tests.""" - self.bot = MagicMock() + self.bot = MockBot() self.cog = security.Security(self.bot) - self.ctx = MagicMock() - self.ctx.author = MagicMock() + self.ctx = MockContext() def test_check_additions(self): """The cog should add its checks after initialization.""" -- cgit v1.2.3