aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-17 19:28:15 -0700
committerGravatar MarkKoz <[email protected]>2020-08-17 19:30:48 -0700
commit67f88e0b63ec9ac198b8204d4b07e6f7ee67937b (patch)
treeb45172488b1f0ca17a3e89ae6adfa70a21a00aec /tests
parentSilence tests: add a test for deletion from the time cache (diff)
Silence tests: add a test for task cancellation
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_silence.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py
index 6f913b8f9..9e81df9c4 100644
--- a/tests/bot/cogs/moderation/test_silence.py
+++ b/tests/bot/cogs/moderation/test_silence.py
@@ -324,6 +324,11 @@ class UnsilenceTests(unittest.IsolatedAsyncioTestCase):
await self.cog._unsilence(self.channel)
self.cog.muted_channel_times.delete.assert_awaited_once_with(self.channel.id)
+ async def test_cancelled_task(self):
+ """The scheduled unsilence task should be cancelled."""
+ await self.cog._unsilence(self.channel)
+ self.cog.scheduler.cancel.assert_called_once_with(self.channel.id)
+
async def test_preserved_other_overwrites(self):
"""Channel's other unrelated overwrites were not changed."""
prev_overwrite_dict = dict(self.overwrite)