aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-20 10:47:59 +0300
committerGravatar GitHub <[email protected]>2020-05-20 10:47:59 +0300
commit1432e5ba36fc09c7233e5be4745f540c2c4af792 (patch)
tree013f746561f92fa997491571276dab53a5d671dd
parentModLog Tests: Fix truncation tests docstring (diff)
Infraction Tests: Small fixes
- Remove unnecessary space from placeholder - Rename `has_active_infraction` to `get_active_infraction`
-rw-r--r--tests/bot/cogs/moderation/test_infractions.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/bot/cogs/moderation/test_infractions.py b/tests/bot/cogs/moderation/test_infractions.py
index 51a8cc645..2b1ff5728 100644
--- a/tests/bot/cogs/moderation/test_infractions.py
+++ b/tests/bot/cogs/moderation/test_infractions.py
@@ -17,11 +17,11 @@ class TruncationTests(unittest.IsolatedAsyncioTestCase):
self.guild = MockGuild(id=4567)
self.ctx = MockContext(bot=self.bot, author=self.user, guild=self.guild)
- @patch("bot.cogs.moderation.utils.has_active_infraction")
+ @patch("bot.cogs.moderation.utils.get_active_infraction")
@patch("bot.cogs.moderation.utils.post_infraction")
- async def test_apply_ban_reason_truncation(self, post_infraction_mock, has_active_mock):
+ async def test_apply_ban_reason_truncation(self, post_infraction_mock, get_active_mock):
"""Should truncate reason for `ctx.guild.ban`."""
- has_active_mock.return_value = False
+ get_active_mock.return_value = 'foo'
post_infraction_mock.return_value = {"foo": "bar"}
self.cog.apply_infraction = AsyncMock()
@@ -32,7 +32,7 @@ class TruncationTests(unittest.IsolatedAsyncioTestCase):
ban = self.cog.apply_infraction.call_args[0][3]
self.assertEqual(
ban.cr_frame.f_locals["kwargs"]["reason"],
- textwrap.shorten("foo bar" * 3000, 512, placeholder=" ...")
+ textwrap.shorten("foo bar" * 3000, 512, placeholder="...")
)
# Await ban to avoid warning
await ban