示例#1
0
文件: test_api.py 项目: subc/anchovy
    def test_attack(self):
        boss_id = create(10, 10)

        result, damage, current = attack(boss_id, 'attacker1', 2)
        self.assertTrue(result)
        self.assertEqual(damage, 2)
        self.assertEqual(current, 8)
示例#2
0
    def test_attack(self):
        boss_id = create(10, 10)

        result, damage, current = attack(boss_id, 'attacker1', 2)
        self.assertTrue(result)
        self.assertEqual(damage, 2)
        self.assertEqual(current, 8)
示例#3
0
文件: test_api.py 项目: subc/anchovy
    def test_result(self):
        boss_id = create(10, 10)

        histories, ranking, assisted = get_result(boss_id)
        self.assertEqual(histories, [])
        self.assertEqual(ranking, [])
        self.assertEqual(assisted, [])

        expr_histories = [('attacker1', 2, 8, None)]
        result, damage, current = attack(boss_id, 'attacker1', 2)

        histories, ranking, assisted = get_result(boss_id)
        self.assertEqual(trim_datetime(histories), expr_histories)
        self.assertEqual(ranking, [('attacker1', 2)])
        self.assertEqual(assisted, ['attacker1'])
示例#4
0
    def test_result(self):
        boss_id = create(10, 10)

        histories, ranking, assisted = get_result(boss_id)
        self.assertEqual(histories, [])
        self.assertEqual(ranking, [])
        self.assertEqual(assisted, [])

        expr_histories = [('attacker1', 2, 8, None)]
        result, damage, current = attack(boss_id, 'attacker1', 2)

        histories, ranking, assisted = get_result(boss_id)
        self.assertEqual(trim_datetime(histories), expr_histories)
        self.assertEqual(ranking, [('attacker1', 2)])
        self.assertEqual(assisted, ['attacker1'])