diff options
| author | 2020-08-17 20:37:24 -0700 | |
|---|---|---|
| committer | 2020-08-18 10:12:06 -0700 | |
| commit | 366f975bbb22c45b9e071644ab4053416bf351fb (patch) | |
| tree | 7f648040e5782477711273b16850b91f0aad073b | |
| parent | Silence tests: remove _reschedule patch for cog tests (diff) | |
Silence tests: add a test for _init_cog rescheduling unsilences
| -rw-r--r-- | tests/bot/cogs/moderation/test_silence.py | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py index 667d61776..5deed2d0b 100644 --- a/tests/bot/cogs/moderation/test_silence.py +++ b/tests/bot/cogs/moderation/test_silence.py @@ -112,6 +112,13 @@ class SilenceCogTests(unittest.IsolatedAsyncioTestCase):          await self.cog._init_cog()          notifier.assert_called_once_with(self.cog._mod_log_channel) +    @autospec(silence, "SilenceNotifier", pass_mocks=False) +    async def test_init_cog_rescheduled(self): +        """`_reschedule_` coroutine was awaited.""" +        self.cog._reschedule = mock.create_autospec(self.cog._reschedule, spec_set=True) +        await self.cog._init_cog() +        self.cog._reschedule.assert_awaited_once_with() +      def test_cog_unload_cancelled_tasks(self):          """All scheduled tasks were cancelled."""          self.cog.cog_unload() | 
