示例#1
0
 def test_dbcache_create_state(self):
     cache = DbCache()
     cache.create_state(Guild(616609333832187924), logger=Log())
     self.assertEqual(
         cache._states[616609333832187924].__repr__(),
         GuildStates(Guild(616609333832187924), logger=Log(),
                     loop=None).__repr__())
     self.assertEqual(cache.__str__(), "Dbcache with states 1 in it")
示例#2
0
 def test_GuildState_init(self):
     guild = Guild(616609333832187924)
     logger = Log()
     guildstate = GuildStates(guild, logger=logger, loop=None)
     self.assertEqual(guildstate.guild, guild)
     self.assertEqual(guildstate.logger, logger)
     self.assertEqual(guildstate.options, {})
     self.assertEqual(guildstate.loop, None)
示例#3
0
 def __init__(self):
     super().__init__(command_prefix=prefix,
                      case_insensitive=True,
                      guild_subscriptions=True,
                      fetch_offline_members=True,
                      intents=Intents.all(),
                      help_command=PrettyHelp(
                          nav=Navigation(":discord:743511195197374563",
                                         "👎", "\U0001F44D"),
                          color=discord.Color.dark_gold()))
     self.client_id = 0
     self.Version = 3.0
     self.log = Log()
     self.scheduler = AsyncIOScheduler()
     self.helper = helper
     self.cache = self.helper.DbCache(self.loop)
     self.sql = Db()
     self.booted = False
示例#4
0
 def test_GuildState_get_levelsystem(self):
     guild = Guild(616609333832187924)
     logger = Log()
     guildstate = GuildStates(guild, logger=logger, loop=None)
     guildstate._levelsystem_toggle = 1
     self.assertEqual(guildstate.get_levelsystem, 1)
示例#5
0
 def test_GuildState_prefix(self):
     guild = Guild(616609333832187924)
     logger = Log()
     guildstate = GuildStates(guild, logger=logger, loop=None)
     self.assertEqual(guildstate.get_prefix, "-")
示例#6
0
 def test_dbcache_destruct_state(self):
     cache = DbCache()
     cache.create_state(Guild(616609333832187924), logger=Log())
     cache.destruct_state(Guild(616609333832187924))
     self.assertEqual(cache.__str__(), "Dbcache with states 0 in it")