aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-14 19:39:45 +0300
committerGravatar ks129 <[email protected]>2020-05-14 19:39:45 +0300
commit72d2f662ff84c8bfca448870e8d7e60777301a68 (patch)
treeac91a3b9c01cba07f1904fcd9790588909ad6e8a
parentMerge branch 'master' into mod-utils-tests (diff)
Mod Utils Tests: Replace `has_active_infraction` with `get_active_infraction`
-rw-r--r--tests/bot/cogs/moderation/test_utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/bot/cogs/moderation/test_utils.py b/tests/bot/cogs/moderation/test_utils.py
index 4f81a2477..248adbcb8 100644
--- a/tests/bot/cogs/moderation/test_utils.py
+++ b/tests/bot/cogs/moderation/test_utils.py
@@ -19,21 +19,21 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
self.user = MockUser(id=1234)
self.ctx = MockContext(bot=self.bot, author=self.member)
- async def test_user_has_active_infraction(self):
+ async def test_user_get_active_infraction(self):
"""
- Should request the API for active infractions and return `True` if the user has one or `False` otherwise.
+ Should request the API for active infractions and return infraction if the user has one or `None` otherwise.
A message should be sent to the context indicating a user already has an infraction, if that's the case.
"""
test_cases = [
{
"get_return_value": [],
- "expected_output": False,
+ "expected_output": None,
"infraction_nr": None
},
{
"get_return_value": [{"id": 123987}],
- "expected_output": True,
+ "expected_output": {"id": 123987},
"infraction_nr": "123987"
}
]
@@ -51,7 +51,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
self.bot.api_client.get.return_value = case["get_return_value"]
- result = await utils.has_active_infraction(self.ctx, self.member, "ban")
+ result = await utils.get_active_infraction(self.ctx, self.member, "ban")
self.assertEqual(result, case["expected_output"])
self.bot.api_client.get.assert_awaited_once_with("bot/infractions", params=params)