diff options
| author | 2020-03-12 19:54:37 +0200 | |
|---|---|---|
| committer | 2020-03-12 19:54:37 +0200 | |
| commit | f793c0772c7b1c5c4edb457fb372e9a57a8200ff (patch) | |
| tree | b5807e2491b36ffeb7784ad010e0f6079905b26c /tests | |
| parent | (Moderation Utils Tests): Create extra new tests set for `post_infraction` te... (diff) | |
(Moderation Utils Tests): Added params to variable in `has_active_infraction` test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bot/cogs/moderation/test_utils.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/bot/cogs/moderation/test_utils.py b/tests/bot/cogs/moderation/test_utils.py index f34a56d50..3432ff595 100644 --- a/tests/bot/cogs/moderation/test_utils.py +++ b/tests/bot/cogs/moderation/test_utils.py @@ -56,15 +56,17 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase): self.bot.api_client.get.reset_mock() self.ctx.send.reset_mock() + params = { + "active": "true", + "type": "ban", + "user__id": str(self.member.id) + } + self.bot.api_client.get.return_value = case["get_return_value"] result = await utils.has_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={ - "active": "true", - "type": "ban", - "user__id": str(self.member.id) - }) + self.bot.api_client.get.assert_awaited_once_with("bot/infractions", params=params) if result: self.assertTrue(case["infraction_nr"] in self.ctx.send.call_args[0][0]) |