aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bot
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-05-25 23:17:53 +0100
committerGravatar GitHub <[email protected]>2020-05-25 23:17:53 +0100
commitd497b761b0b2c5deec21500912c979ceb57fe507 (patch)
treec56339148e80bb9e2af5b6cffbf92da49163d60f /tests/bot
parentFiltering: don't attempt to send additional embeds for invalid invites (diff)
parentAdd discord.gift to URL blacklist, closes #958 (diff)
Merge branch 'master' into bug/filters/929/invalid-invites
Diffstat (limited to 'tests/bot')
-rw-r--r--tests/bot/cogs/test_snekbox.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/bot/cogs/test_snekbox.py b/tests/bot/cogs/test_snekbox.py
index 1dec0ccaf..14299e766 100644
--- a/tests/bot/cogs/test_snekbox.py
+++ b/tests/bot/cogs/test_snekbox.py
@@ -208,10 +208,9 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase):
async def test_eval_command_call_help(self):
"""Test if the eval command call the help command if no code is provided."""
- ctx = MockContext()
- ctx.invoke = AsyncMock()
+ ctx = MockContext(command="sentinel")
await self.cog.eval_command.callback(self.cog, ctx=ctx, code='')
- ctx.invoke.assert_called_once_with(self.bot.get_command("help"), "eval")
+ ctx.send_help.assert_called_once_with("sentinel")
async def test_send_eval(self):
"""Test the send_eval function."""
@@ -291,7 +290,11 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(actual, expected)
self.bot.wait_for.assert_has_awaits(
(
- call('message_edit', check=partial_mock(snekbox.predicate_eval_message_edit, ctx), timeout=10),
+ call(
+ 'message_edit',
+ check=partial_mock(snekbox.predicate_eval_message_edit, ctx),
+ timeout=snekbox.REEVAL_TIMEOUT,
+ ),
call('reaction_add', check=partial_mock(snekbox.predicate_eval_emoji_reaction, ctx), timeout=10)
)
)