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")
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)
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
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)
def test_GuildState_prefix(self): guild = Guild(616609333832187924) logger = Log() guildstate = GuildStates(guild, logger=logger, loop=None) self.assertEqual(guildstate.get_prefix, "-")
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")