Пример #1
0
    def setUpClass(cls):
        """Set up the bot and User cog"""

        cls.bot = commands.Bot(command_prefix='!')
        cls.userCog = usercog.UserCog(cls.bot)
        cls.bot.add_cog(cls.userCog)
        cls.bot.add_cog(animecog.AnimeCog(cls.bot))
        cls.bot.add_cog(mangacog.MangaCog(cls.bot))
Пример #2
0
 def __init__(self, *args, **kwargs):
     """
     Constructor: initialize the bot and add all the cogs.
     """
     super().__init__(*args, **kwargs)
     self.add_cog(usercog.UserCog(self))
     self.add_cog(animecog.AnimeCog(self))
     self.add_cog(mangacog.MangaCog(self))
     self.add_cog(databasecog.DatabaseCog(self))
Пример #3
0
    def setUpClass(cls):
        """Set up the bot and Manga cog, as well as some premade manga elements"""

        cls.bot = commands.Bot(command_prefix='!')
        cls.mangaCog = mangacog.MangaCog(cls.bot)
        cls.bot.add_cog(cls.mangaCog)

        with open('test/test_data/mangarock_1.html') as file:
            tree = html.fromstring(file.read())
            cls.mangas1 = cls.mangaCog.source._findMangaElements(tree)
        with open('test/test_data/mangarock_2.html') as file:
            tree = html.fromstring(file.read())
            cls.mangas2 = cls.mangaCog.source._findMangaElements(tree)