aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-08 08:39:40 +0200
committerGravatar ks123 <[email protected]>2020-03-08 08:39:40 +0200
commit2870472eae2f62982283d160378ca6953231da4e (patch)
tree9b48434c8faadbd6a8ffc10c2190d906c9f2aa8b /tests
parent(Moderation Utils Tests): Removed `Dict` unpacking in `notify_infraction` test. (diff)
(Moderation Utils Tests): Removed unnecessary `ctx.send` `side_effect` and removed these in test cases too in `notify_infraction` test.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_utils.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/bot/cogs/moderation/test_utils.py b/tests/bot/cogs/moderation/test_utils.py
index d6e300c89..5ab279391 100644
--- a/tests/bot/cogs/moderation/test_utils.py
+++ b/tests/bot/cogs/moderation/test_utils.py
@@ -86,8 +86,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"icon_url": Icons.token_removed,
"footer": INFRACTION_APPEAL_FOOTER,
},
- "send_result": True,
- "send_raise": None
+ "send_result": True
},
{
"args": (self.user, "warning", None, "Test reason."),
@@ -100,8 +99,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"icon_url": Icons.token_removed,
"footer": Embed.Empty
},
- "send_result": False,
- "send_raise": Forbidden(AsyncMock(), AsyncMock())
+ "send_result": False
},
{
"args": (self.user, "note", None, None, Icons.defcon_denied),
@@ -114,8 +112,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"icon_url": Icons.defcon_denied,
"footer": Embed.Empty
},
- "send_result": False,
- "send_raise": NotFound(AsyncMock(), AsyncMock())
+ "send_result": False
},
{
"args": (self.user, "mute", "2020-02-26 09:20 (23 hours and 59 minutes)", "Test", Icons.defcon_denied),
@@ -128,19 +125,16 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"icon_url": Icons.defcon_denied,
"footer": INFRACTION_APPEAL_FOOTER
},
- "send_result": False,
- "send_raise": HTTPException(AsyncMock(), AsyncMock())
+ "send_result": False
}
]
for case in test_cases:
args = case["args"]
expected = case["expected_output"]
- send, send_raise = case["send_result"], case["send_raise"]
+ send = case["send_result"]
- with self.subTest(args=args, expected=expected, send=send, send_raise=send_raise):
- if send_raise:
- self.ctx.send.side_effect = send_raise
+ with self.subTest(args=args, expected=expected, send=send):
send_private_embed_mock.return_value = send