def test_damage_divine_shield(self): attacker = create_entity(attack=1) defender = create_entity(health=2, divine_shield=True) combat = SimulatedCombat(([attacker], [defender])) combat.damage([defender], attacker) self.assertEqual(defender.health, 2) self.assertEqual(defender.divine_shield, False)
def test_handle_entity_death_trigger_reborn(self): friendly = create_entity(deathrattle=False, reborn=True) combat = SimulatedCombat(([friendly], [])) # combat.handle_entity_death(friendly) combat.damage([combat.controllers[0][0]], friendly, friendly.health) combat.clean_up_dead_minions() self.assertEqual(len(combat.controllers[0]), 1) self.assertEqual(combat.controllers[0][0].reborn, False)
def test_damage_poisonous(self): attacker = create_entity(attack=1, poisonous=True) defender = create_entity(health=2) combat = SimulatedCombat(([attacker], [defender])) combat.damage([defender], attacker) self.assertEqual(defender.health, 0)
def test_damage_simple(self): attacker = create_entity(attack=1) defender = create_entity(health=2) combat = SimulatedCombat(([attacker], [defender])) combat.damage([defender], attacker) self.assertEqual(defender.health, 1)