diff options
author | 2020-05-17 12:10:56 +0200 | |
---|---|---|
committer | 2020-05-17 12:25:48 +0200 | |
commit | 4e24e9c43a331ebc0f9b598f4de6c45e04216782 (patch) | |
tree | 2cc2cdeb401b39c618c597c02965fa59473d0d98 /tests | |
parent | Merge pull request #519 from mathsman5133/help-refactor (diff) |
Use `send_help` to invoke command help
After the refactoring of the help command, we need to use the built-in
method of calling the help command: `Context.send_help`. As an argument,
the qualified name (a string containing the full command path, including
parents) of the command can be passed.
Examples:
- await ctx.send_help("reminders edit")
This would send a help embed with information on `!reminders edit` to
the Context.
- await ctx.send_help(ctx.command.qualified_name)
This would extract the qualified name of the command, which is the full
command path, and send a help embed to Context.
- await ctx.send_help()
This will send the main "root" help embed to the Context.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/cogs/test_snekbox.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/bot/cogs/test_snekbox.py b/tests/bot/cogs/test_snekbox.py index 1dec0ccaf..190d41d66 100644 --- a/tests/bot/cogs/test_snekbox.py +++ b/tests/bot/cogs/test_snekbox.py @@ -209,9 +209,8 @@ 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() 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("eval") async def test_send_eval(self): """Test the send_eval function.""" |