aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Karlis S <[email protected]>2020-03-13 18:03:40 +0000
committerGravatar Karlis S <[email protected]>2020-03-13 18:03:40 +0000
commit99e1239f4734d0ed34688fa77d5094f8984b9209 (patch)
treeea18b5ae18549861e6b7e554b495b79984b56f78 /tests
parent(Moderation Utils Tests): Removed Pardon Color constant. (diff)
(Mod Utils + Tests): Moved constants from tests to utils, applied change
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_utils.py40
1 files changed, 14 insertions, 26 deletions
diff --git a/tests/bot/cogs/moderation/test_utils.py b/tests/bot/cogs/moderation/test_utils.py
index 52bdb5fbc..4f81a2477 100644
--- a/tests/bot/cogs/moderation/test_utils.py
+++ b/tests/bot/cogs/moderation/test_utils.py
@@ -9,18 +9,6 @@ from bot.cogs.moderation import utils
from bot.constants import Colours, Icons
from tests.helpers import MockBot, MockContext, MockMember, MockUser
-APPEAL_EMAIL = "[email protected]"
-
-INFRACTION_TITLE = f"Please review our rules over at {utils.RULES_URL}"
-INFRACTION_APPEAL_FOOTER = f"To appeal this infraction, send an e-mail to {APPEAL_EMAIL}"
-INFRACTION_AUTHOR_NAME = "Infraction information"
-
-INFRACTION_DESCRIPTION_TEMPLATE = (
- "\n**Type:** {type}\n"
- "**Expires:** {expires}\n"
- "**Reason:** {reason}\n"
-)
-
class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"""Tests Moderation utils."""
@@ -82,8 +70,8 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
{
"args": (self.user, "ban", "2020-02-26 09:20 (23 hours and 59 minutes)"),
"expected_output": Embed(
- title=INFRACTION_TITLE,
- description=INFRACTION_DESCRIPTION_TEMPLATE.format(
+ title=utils.INFRACTION_TITLE,
+ description=utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Ban",
expires="2020-02-26 09:20 (23 hours and 59 minutes)",
reason="No reason provided."
@@ -91,17 +79,17 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
colour=Colours.soft_red,
url=utils.RULES_URL
).set_author(
- name=INFRACTION_AUTHOR_NAME,
+ name=utils.INFRACTION_AUTHOR_NAME,
url=utils.RULES_URL,
icon_url=Icons.token_removed
- ).set_footer(text=INFRACTION_APPEAL_FOOTER),
+ ).set_footer(text=utils.INFRACTION_APPEAL_FOOTER),
"send_result": True
},
{
"args": (self.user, "warning", None, "Test reason."),
"expected_output": Embed(
- title=INFRACTION_TITLE,
- description=INFRACTION_DESCRIPTION_TEMPLATE.format(
+ title=utils.INFRACTION_TITLE,
+ description=utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Warning",
expires="N/A",
reason="Test reason."
@@ -109,7 +97,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
colour=Colours.soft_red,
url=utils.RULES_URL
).set_author(
- name=INFRACTION_AUTHOR_NAME,
+ name=utils.INFRACTION_AUTHOR_NAME,
url=utils.RULES_URL,
icon_url=Icons.token_removed
),
@@ -118,8 +106,8 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
{
"args": (self.user, "note", None, None, Icons.defcon_denied),
"expected_output": Embed(
- title=INFRACTION_TITLE,
- description=INFRACTION_DESCRIPTION_TEMPLATE.format(
+ title=utils.INFRACTION_TITLE,
+ description=utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Note",
expires="N/A",
reason="No reason provided."
@@ -127,7 +115,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
colour=Colours.soft_red,
url=utils.RULES_URL
).set_author(
- name=INFRACTION_AUTHOR_NAME,
+ name=utils.INFRACTION_AUTHOR_NAME,
url=utils.RULES_URL,
icon_url=Icons.defcon_denied
),
@@ -136,8 +124,8 @@ 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=INFRACTION_TITLE,
- description=INFRACTION_DESCRIPTION_TEMPLATE.format(
+ title=utils.INFRACTION_TITLE,
+ description=utils.INFRACTION_DESCRIPTION_TEMPLATE.format(
type="Mute",
expires="2020-02-26 09:20 (23 hours and 59 minutes)",
reason="Test"
@@ -145,10 +133,10 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
colour=Colours.soft_red,
url=utils.RULES_URL
).set_author(
- name=INFRACTION_AUTHOR_NAME,
+ name=utils.INFRACTION_AUTHOR_NAME,
url=utils.RULES_URL,
icon_url=Icons.defcon_denied
- ).set_footer(text=INFRACTION_APPEAL_FOOTER),
+ ).set_footer(text=utils.INFRACTION_APPEAL_FOOTER),
"send_result": False
}
]