diff options
| author | 2020-08-17 19:25:15 -0700 | |
|---|---|---|
| committer | 2020-08-17 19:25:15 -0700 | |
| commit | 1e1d358ae38bb9d554e993fb61ee8f0b52f977b5 (patch) | |
| tree | 3180cec58b14edb4e7216024b8aa234b4629c926 | |
| parent | Silence tests: add a test for caching permanent times (diff) | |
Silence tests: add tests for scheduling tasks
| -rw-r--r-- | tests/bot/cogs/moderation/test_silence.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py index 2e756a88f..979b4f4e5 100644 --- a/tests/bot/cogs/moderation/test_silence.py +++ b/tests/bot/cogs/moderation/test_silence.py @@ -241,6 +241,18 @@ class SilenceTests(unittest.IsolatedAsyncioTestCase): await self.cog.silence.callback(self.cog, ctx, None) self.cog.muted_channel_times.set.assert_awaited_once_with(ctx.channel.id, -1) + async def test_scheduled_task(self): + """An unsilence task was scheduled.""" + ctx = MockContext(channel=self.channel) + await self.cog.silence.callback(self.cog, ctx) + self.cog.scheduler.schedule_later.assert_called_once() + + async def test_permanent_not_scheduled(self): + """A task was not scheduled for a permanent silence.""" + ctx = MockContext(channel=self.channel) + await self.cog.silence.callback(self.cog, ctx, None) + self.cog.scheduler.schedule_later.assert_not_called() + @autospec(Silence, "muted_channel_times", pass_mocks=False) class UnsilenceTests(unittest.IsolatedAsyncioTestCase): |