aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-08 09:01:18 +0200
committerGravatar ks123 <[email protected]>2020-03-08 09:01:18 +0200
commit4260d3cf60f01f0de55a95290dd038d8a5c079ca (patch)
tree5a96eeceb4ea7169acae9ca3713b4d158cfdfcfe /tests
parent(Moderation Utils Tests): Moved `notify_infraction` embed check from dict to ... (diff)
(Moderation Utils Tests): Removed unnecessary `ctx.send` `side_effect` from `notify_pardon`, applied changes to test cases.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_utils.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/bot/cogs/moderation/test_utils.py b/tests/bot/cogs/moderation/test_utils.py
index 9844c02f9..3616b3cf0 100644
--- a/tests/bot/cogs/moderation/test_utils.py
+++ b/tests/bot/cogs/moderation/test_utils.py
@@ -181,8 +181,7 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"title": "Test title",
"icon_url": Icons.user_verified
},
- "send_result": True,
- "send_raise": None
+ "send_result": True
},
{
"args": (self.user, "Test title 1", "Example content 1", Icons.user_update),
@@ -191,24 +190,21 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
"title": "Test title 1",
"icon_url": Icons.user_update
},
- "send_result": False,
- "send_raise": NotFound(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):
- if send_raise:
- self.ctx.send.side_effect = send_raise
+ send_private_embed_mock.reset_mock()
send_private_embed_mock.return_value = send
result = await utils.notify_pardon(*args)
-
self.assertEqual(send, result)
embed = send_private_embed_mock.call_args[0][1]
@@ -220,9 +216,6 @@ class ModerationUtilsTests(unittest.IsolatedAsyncioTestCase):
send_private_embed_mock.assert_awaited_once_with(args[0], embed)
- self.ctx.send.reset_mock(side_effect=True)
- send_private_embed_mock.reset_mock()
-
async def test_post_user(self):
"""Test does `post_user` handle errors and results correctly."""
test_cases = [