aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-17 19:25:15 -0700
committerGravatar MarkKoz <[email protected]>2020-08-17 19:25:15 -0700
commit1e1d358ae38bb9d554e993fb61ee8f0b52f977b5 (patch)
tree3180cec58b14edb4e7216024b8aa234b4629c926 /tests
parentSilence tests: add a test for caching permanent times (diff)
Silence tests: add tests for scheduling tasks
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_silence.py12
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):