aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-04-02 22:50:33 +0100
committerGravatar Chris Lovering <[email protected]>2022-04-18 17:46:08 +0100
commit0afe07d0734e50854d7abd8685086e79858fcadf (patch)
treed937ec38a97a42e8a45ebc3f809bef627647e60c
parentUpdate tests to use new async cog_load function (diff)
Remove sync cog init test
Discord.py now implicitly calls the new async cog_load function from within it's internals on load. There is no longer a need to test that this happens.
-rw-r--r--tests/bot/exts/backend/sync/test_cog.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/tests/bot/exts/backend/sync/test_cog.py b/tests/bot/exts/backend/sync/test_cog.py
index 4e9941d88..28afeebeb 100644
--- a/tests/bot/exts/backend/sync/test_cog.py
+++ b/tests/bot/exts/backend/sync/test_cog.py
@@ -60,23 +60,6 @@ class SyncCogTestCase(unittest.IsolatedAsyncioTestCase):
class SyncCogTests(SyncCogTestCase):
"""Tests for the Sync cog."""
- @mock.patch("botcore.utils.scheduling.create_task")
- @mock.patch.object(Sync, "sync_guild", new_callable=mock.MagicMock)
- def test_sync_cog_init(self, sync_guild, create_task):
- """Should instantiate syncers and run a sync for the guild."""
- # Reset because a Sync cog was already instantiated in setUp.
- self.RoleSyncer.reset_mock()
- self.UserSyncer.reset_mock()
-
- mock_sync_guild_coro = mock.MagicMock()
- sync_guild.return_value = mock_sync_guild_coro
-
- Sync(self.bot)
-
- sync_guild.assert_called_once_with()
- create_task.assert_called_once()
- self.assertEqual(create_task.call_args.args[0], mock_sync_guild_coro)
-
async def test_sync_cog_sync_guild(self):
"""Roles and users should be synced only if a guild is successfully retrieved."""
for guild in (helpers.MockGuild(), None):