aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-05-11 11:44:08 -0700
committerGravatar MarkKoz <[email protected]>2020-05-11 12:03:13 -0700
commit5734a4d84922a9497014dfeb3eba31ad3c57536f (patch)
treed9a9f97d4912eb13d67efa1215a46aed8985cee3 /tests
parentTest TokenRemover.take_action (diff)
Refactor `TokenRemoverSetupTests` and add a more thorough test
The test now ensures the cog is instantiated and that the instance is passed as an argument to `add_cog`.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_token_remover.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/bot/cogs/test_token_remover.py b/tests/bot/cogs/test_token_remover.py
index 3546e7964..c377de7b2 100644
--- a/tests/bot/cogs/test_token_remover.py
+++ b/tests/bot/cogs/test_token_remover.py
@@ -262,11 +262,15 @@ class TokenRemoverTests(unittest.IsolatedAsyncioTestCase):
)
-class TokenRemoverSetupTests(unittest.TestCase):
- """Tests setup of the `TokenRemover` cog."""
+class TokenRemoverExtensionTests(unittest.TestCase):
+ """Tests for the token_remover extension."""
- def test_setup(self):
- """Setup of the extension should call add_cog."""
+ @autospec("bot.cogs.token_remover", "TokenRemover")
+ def test_extension_setup(self, cog):
+ """The TokenRemover cog should be added."""
bot = MockBot()
setup_cog(bot)
+
+ cog.assert_called_once_with(bot)
bot.add_cog.assert_called_once()
+ self.assertTrue(isinstance(bot.add_cog.call_args.args[0], TokenRemover))