aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-03 17:03:44 +0300
committerGravatar ks129 <[email protected]>2020-04-03 17:03:44 +0300
commit0917d9d1c15febeb79064065983bf19b0b02b55d (patch)
treec87785acd149a8c0c08d8aab1509ff12ab10f020 /tests
parent(Information Tests, discord.py 1.3.x Migration): Moved from `unittest.TestCas... (diff)
(Information Tests, discord.py 1.3.x Migration): In `InformationCogTests`, replaced `.callback` calls with direct command awaits.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_information.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/bot/cogs/test_information.py b/tests/bot/cogs/test_information.py
index f3cc2ccbd..7137949a0 100644
--- a/tests/bot/cogs/test_information.py
+++ b/tests/bot/cogs/test_information.py
@@ -37,9 +37,7 @@ class InformationCogTests(unittest.IsolatedAsyncioTestCase):
self.cog.roles_info.can_run = unittest.mock.AsyncMock()
self.cog.roles_info.can_run.return_value = True
- coroutine = self.cog.roles_info.callback(self.cog, self.ctx)
-
- self.assertIsNone(asyncio.run(coroutine))
+ self.assertIsNone(await self.cog.roles_info(self.ctx))
self.ctx.send.assert_called_once()
_, kwargs = self.ctx.send.call_args
@@ -74,9 +72,7 @@ class InformationCogTests(unittest.IsolatedAsyncioTestCase):
self.cog.role_info.can_run = unittest.mock.AsyncMock()
self.cog.role_info.can_run.return_value = True
- coroutine = self.cog.role_info.callback(self.cog, self.ctx, dummy_role, admin_role)
-
- self.assertIsNone(asyncio.run(coroutine))
+ self.assertIsNone(await self.cog.role_info(self.ctx, dummy_role, admin_role))
self.assertEqual(self.ctx.send.call_count, 2)
@@ -133,8 +129,7 @@ class InformationCogTests(unittest.IsolatedAsyncioTestCase):
icon_url='a-lemon.jpg',
)
- coroutine = self.cog.server_info.callback(self.cog, self.ctx)
- self.assertIsNone(asyncio.run(coroutine))
+ self.assertIsNone(await self.cog.server_info(self.ctx))
time_since_patch.assert_called_once_with(self.ctx.guild.created_at, precision='days')
_, kwargs = self.ctx.send.call_args