aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-30 10:07:21 +0300
committerGravatar ks129 <[email protected]>2020-05-30 10:07:21 +0300
commit323317496310ef474a39d468e273703106e44768 (patch)
tree30e8a5d5c389e0df803a1fb5f93a2ca78bb50b1e
parentScheduler: Remove unnecessary `f` before string (diff)
Infr. Tests: Add `apply_infraction` awaiting assertion with args
-rw-r--r--tests/bot/cogs/moderation/test_infractions.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/bot/cogs/moderation/test_infractions.py b/tests/bot/cogs/moderation/test_infractions.py
index ad3c95958..da4e92ccc 100644
--- a/tests/bot/cogs/moderation/test_infractions.py
+++ b/tests/bot/cogs/moderation/test_infractions.py
@@ -35,6 +35,9 @@ class TruncationTests(unittest.IsolatedAsyncioTestCase):
reason=textwrap.shorten("foo bar" * 3000, 512, placeholder="..."),
delete_message_days=0
)
+ self.cog.apply_infraction.assert_awaited_once_with(
+ self.ctx, {"foo": "bar"}, self.target, self.ctx.guild.ban.return_value
+ )
@patch("bot.cogs.moderation.utils.post_infraction")
async def test_apply_kick_reason_truncation(self, post_infraction_mock):
@@ -47,3 +50,6 @@ class TruncationTests(unittest.IsolatedAsyncioTestCase):
await self.cog.apply_kick(self.ctx, self.target, "foo bar" * 3000)
self.target.kick.assert_called_once_with(reason=textwrap.shorten("foo bar" * 3000, 512, placeholder="..."))
+ self.cog.apply_infraction.assert_awaited_once_with(
+ self.ctx, {"foo": "bar"}, self.target, self.target.kick.return_value
+ )