aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-06-24 15:36:34 +0300
committerGravatar ks129 <[email protected]>2020-06-24 15:36:34 +0300
commit7b89d2cfad91cc9a56565ebc7700f4858814f149 (patch)
tree205670b959d56148c8c8567e0d87f62bd92d478c /tests
parentFix test case key name in `test_notify_infraction` (diff)
Move infraction description template back to main file, apply it there
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_utils.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/bot/cogs/moderation/test_utils.py b/tests/bot/cogs/moderation/test_utils.py
index c4d0d6f16..c35c0edf5 100644
--- a/tests/bot/cogs/moderation/test_utils.py
+++ b/tests/bot/cogs/moderation/test_utils.py
@@ -11,12 +11,6 @@ from bot.cogs.moderation import utils
from bot.constants import Colours, Icons
from tests.helpers import MockBot, MockContext, MockMember, MockUser
-INFRACTION_DESCRIPTION_TEMPLATE = (
- "\n**Type:** {type}\n"
- "**Expires:** {expires}\n"
- "**Reason:** {reason}\n"
-)
-
class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"""Tests Moderation utils."""
@@ -77,7 +71,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"args": (self.user, "ban", "2020-02-26 09:20 (23 hours and 59 minutes)"),
"expected_output": Embed(
title=utils.INFRACTION_TITLE,
- description=textwrap.shorten(INFRACTION_DESCRIPTION_TEMPLATE.format(
+ description=textwrap.shorten(utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Ban",
expires="2020-02-26 09:20 (23 hours and 59 minutes)",
reason="No reason provided."
@@ -95,7 +89,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"args": (self.user, "warning", None, "Test reason."),
"expected_output": Embed(
title=utils.INFRACTION_TITLE,
- description=textwrap.shorten(INFRACTION_DESCRIPTION_TEMPLATE.format(
+ description=textwrap.shorten(utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Warning",
expires="N/A",
reason="Test reason."
@@ -113,7 +107,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"args": (self.user, "note", None, None, Icons.defcon_denied),
"expected_output": Embed(
title=utils.INFRACTION_TITLE,
- description=textwrap.shorten(INFRACTION_DESCRIPTION_TEMPLATE.format(
+ description=textwrap.shorten(utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Note",
expires="N/A",
reason="No reason provided."
@@ -131,7 +125,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"args": (self.user, "mute", "2020-02-26 09:20 (23 hours and 59 minutes)", "Test", Icons.defcon_denied),
"expected_output": Embed(
title=utils.INFRACTION_TITLE,
- description=textwrap.shorten(INFRACTION_DESCRIPTION_TEMPLATE.format(
+ description=textwrap.shorten(utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Mute",
expires="2020-02-26 09:20 (23 hours and 59 minutes)",
reason="Test"
@@ -149,7 +143,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"args": (self.user, "mute", None, "foo bar" * 4000, Icons.defcon_denied),
"expected_output": Embed(
title=utils.INFRACTION_TITLE,
- description=textwrap.shorten(INFRACTION_DESCRIPTION_TEMPLATE.format(
+ description=textwrap.shorten(utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Mute",
expires="N/A",
reason="foo bar" * 4000