示例#1
0
文件: test.py 项目: 3-24/nalgang
 def testNalgangGuildDependent(self):
     m1 = Member(None)
     m1.id = 1
     m1.name = "Alice"
     m1.guild = 2222
     m1.add_db()
     m2 = Member(None)
     m2.id = 1
     m2.name = "Alice"
     m2.guild = 2223
     m2.add_db()
     m1.nalgang("")
     m2.nalgang("")
     self.assertEqual(m1.get_point(), config.point_by_rank[0])
     self.assertEqual(m2.get_point(), config.point_by_rank[0])
示例#2
0
 def testDatabase(self):
     m1 = Member(None)
     m1.id_num = 1
     m1.name = "Alice"
     m1.add_db(point=123456, combo=654321)
     self.assertEqual(m1.get_point(), 123456)
     self.assertEqual(m1.get_combo(), 654321)
示例#3
0
 def testNalgangMonthBonus(self):
     m1 = Member(None)
     m1.id_num = 1
     m1.name = "Alice"
     m1.add_db(combo=29)
     m1.nalgang("")
     self.assertEqual(m1.get_point(),
                      config.point_by_rank[0] + config.month_bonus)
     self.assertEqual(m1.get_combo(), 30)
示例#4
0
 def testNalgang(self):
     m1 = Member(None)
     m1.id_num = 1
     m1.name = "Alice"
     m1.add_db()
     m1.nalgang("")
     self.assertEqual(m1.get_point(), config.point_by_rank[0])
     self.assertEqual(m1.get_combo(), 1)
     self.assertIsNone(m1.nalgang(""))
示例#5
0
文件: test.py 项目: 3-24/nalgang
 def testNalgangWeekBonus(self):
     m1 = Member(None)
     m1.id = 1
     m1.name = "Alice"
     m1.guild = 2222
     m1.add_db(combo=6)
     m1.nalgang("")
     self.assertEqual(m1.get_point(),
                      config.point_by_rank[0] + config.week_bonus)
     self.assertEqual(m1.get_combo(), 7)
示例#6
0
文件: test.py 项目: 3-24/nalgang
 def testNalgangPreciseDayReset(self):
     m1 = Member(None)
     m1.id = 1
     m1.guild = 2222
     m1.add_db()
     m1.name = "Alice"
     m1.nalgang("", datetime(2020, 5, 7, hour=5, minute=59, second=59))
     self.assertEqual(m1.get_point(), config.point_by_rank[0])
     self.assertEqual(m1.get_combo(), 1)
     m1.nalgang("", datetime(2020, 5, 7, hour=6, minute=00, second=00))
     self.assertEqual(m1.get_point(), config.point_by_rank[0] * 2)
     self.assertEqual(m1.get_combo(), 2)
示例#7
0
文件: test.py 项目: 3-24/nalgang
 def testNalgangDayReset(self):
     m1 = Member(None)
     m1.id = 1
     m1.name = "Alice"
     m1.guild = 2222
     m1.add_db()
     m1.nalgang("")
     self.assertEqual(m1.get_point(), config.point_by_rank[0])
     self.assertEqual(m1.get_combo(), 1)
     time1 = datetime.today() + timedelta(days=1)
     m1.nalgang("", time1)
     self.assertEqual(m1.get_point(), config.point_by_rank[0] * 2)
     self.assertEqual(m1.get_combo(), 2)
     time2 = datetime.today() + timedelta(days=2)
     m1.nalgang("", time2)
     self.assertEqual(m1.get_point(), config.point_by_rank[0] * 3)
     self.assertEqual(m1.get_combo(), 3)