aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-18 12:02:29 -0700
committerGravatar MarkKoz <[email protected]>2020-08-18 12:12:39 -0700
commita9ddbf346d95e67731196d8d822835330b6992af (patch)
treeea86f06997bdb22f2cdc1f7d9e7f5a25c276ea5a /tests
parentSilence tests: add a test for rescheduling active silences (diff)
Silence tests: more accurately assert the silence cmd schedule a task
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_silence.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py
index 3d111341b..bc41422ef 100644
--- a/tests/bot/cogs/moderation/test_silence.py
+++ b/tests/bot/cogs/moderation/test_silence.py
@@ -328,9 +328,13 @@ class SilenceTests(unittest.IsolatedAsyncioTestCase):
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()
+ ctx = MockContext(channel=self.channel, invoke=mock.MagicMock())
+
+ await self.cog.silence.callback(self.cog, ctx, 5)
+
+ args = (300, ctx.channel.id, ctx.invoke.return_value)
+ self.cog.scheduler.schedule_later.assert_called_once_with(*args)
+ ctx.invoke.assert_called_once_with(self.cog.unsilence)
async def test_permanent_not_scheduled(self):
"""A task was not scheduled for a permanent silence."""