Esempio n. 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")
Esempio n. 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)
Esempio n. 3
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)
Esempio n. 4
0
 def test_GuildState_prefix(self):
     guild = Guild(616609333832187924)
     logger = Log()
     guildstate = GuildStates(guild, logger=logger, loop=None)
     self.assertEqual(guildstate.get_prefix, "-")
Esempio n. 5
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")
Esempio n. 6
0
 def test_init_ctx(self):
     ctx = Ctx(member=Member(Guild(616609333832187924), "Test"))
     self.assertEqual(ctx.guild.id, 616609333832187924)