diff options
author | 2020-03-17 13:23:44 +0100 | |
---|---|---|
committer | 2020-03-17 13:23:44 +0100 | |
commit | 039a04462be58e9d345e32efcae13c8c999776db (patch) | |
tree | f253ff1b8aa75e6e45f0a70d4fa8726a0f807910 /tests | |
parent | Handle and log `CommandErrors` on `.can_run`. (diff) |
Fix `test_cog_unload` passing tests with invalid values.
The first assert - `asyncio_mock.create_task.assert_called_once_with`
called `alert_channel`'s send resulting in an extra call.
`send` on `alert_channel` was not tested properly because of a typo
and a missing assert in the method call.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/cogs/moderation/test_silence.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py index c6f1fc1da..febfd584b 100644 --- a/tests/bot/cogs/moderation/test_silence.py +++ b/tests/bot/cogs/moderation/test_silence.py @@ -202,8 +202,8 @@ class SilenceTests(unittest.IsolatedAsyncioTestCase): """Task for sending an alert was created with present `muted_channels`.""" with mock.patch.object(self.cog, "muted_channels"): self.cog.cog_unload() + alert_channel.send.assert_called_once_with(f"<@&{Roles.moderators}> channels left silenced on cog unload: ") asyncio_mock.create_task.assert_called_once_with(alert_channel.send()) - alert_channel.send.called_once_with(f"<@&{Roles.moderators}> chandnels left silenced on cog unload: ") @mock.patch("bot.cogs.moderation.silence.asyncio") def test_cog_unload1(self, asyncio_mock): |