示例#1
0
 def test_long(self):
     bot = Bot("app_name", "version")
     bot.register_command("test1", None, None, "long desc")
     message = AsyncMock()
     self._await(bot.help(None, message, "help", "test1"))
     message.channel.send.assert_awaited_once_with("long desc",
                                                   reference=message,
                                                   mention_author=False)
示例#2
0
 def test_not_found(self):
     bot = Bot("app_name", "version")
     message = AsyncMock()
     self._await(bot.help(None, message, "help", "notfound"))
     message.channel.send.assert_awaited_once_with(
         f"Command `notfound` not found",
         reference=message,
         mention_author=False,
     )
示例#3
0
 def test_list_alias(self):
     bot = Bot("app_name", "version", alias="¡")
     message = AsyncMock()
     self._await(bot.help(None, message, "help"))
     message.channel.send.assert_awaited_once_with(
         f"```\n"
         f"List of available commands:\n"
         f"* ¡info: show description\n"
         f"* ¡help: show this help\n"
         f"```",
         reference=message,
         mention_author=False,
     )
示例#4
0
 def test_list_functions(self):
     bot = Bot("app_name", "version")
     bot.register_command("", None, "test1: desc1", None)
     bot.register_command("", None, "test2: desc2", None)
     message = AsyncMock()
     self._await(bot.help(None, message, "help"))
     message.channel.send.assert_awaited_once_with(
         f"```\n"
         f"List of available commands:\n"
         f"* test2: desc2\n"
         f"* test1: desc1\n"
         f"* info: show description\n"
         f"* help: show this help\n"
         f"```",
         reference=message,
         mention_author=False,
     )