diff options
| author | 2020-08-18 10:53:33 -0700 | |
|---|---|---|
| committer | 2020-08-18 10:54:31 -0700 | |
| commit | d44e3f795f8c56a1fbbce2833b27474b263e911b (patch) | |
| tree | 9bb6bbc9365756d81b0409a4cdd849d9efc56642 | |
| parent | Silence tests: test the scheduler skips missing channels (diff) | |
Silence tests: test the rescheduler adds permanent silence to notifier
| -rw-r--r-- | tests/bot/cogs/moderation/test_silence.py | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py index 2c8059752..6e8c9ff38 100644 --- a/tests/bot/cogs/moderation/test_silence.py +++ b/tests/bot/cogs/moderation/test_silence.py @@ -157,6 +157,20 @@ class RescheduleTests(unittest.IsolatedAsyncioTestCase):          self.cog._unsilence_wrapper.assert_not_called()          self.cog.scheduler.schedule_later.assert_not_called() +    async def test_added_permanent_to_notifier(self): +        """Permanently silenced channels were added to the notifier.""" +        channels = [MockTextChannel(id=123), MockTextChannel(id=456)] +        self.bot.get_channel.side_effect = channels +        self.cog.muted_channel_times.items.return_value = [(123, -1), (456, -1)] + +        await self.cog._reschedule() + +        self.cog.notifier.add_channel.assert_any_call(channels[0]) +        self.cog.notifier.add_channel.assert_any_call(channels[1]) + +        self.cog._unsilence_wrapper.assert_not_called() +        self.cog.scheduler.schedule_later.assert_not_called() +  @autospec(silence.Silence, "muted_channel_perms", "muted_channel_times", pass_mocks=False)  class SilenceTests(unittest.IsolatedAsyncioTestCase): | 
