def test_is_not_alive_below_zero(self): weapon = Unarmed(base_value=0, dice_quantity=0, dice_max=0, weight=0, value=0) creature = Creature(first_name="John", second_name="Doe", stats=Stats(), status=Status(), weapon=weapon) creature._stats._health = -1 self.assertEqual(-1, creature.stats().health()) self.assertEqual(False, creature.is_alive())
def setUp(self) -> None: """ Creates two goblin instances for each test. They both have all stats at 0 and a sword. """ sword = Sword(base_value=0, dice_quantity=0, dice_max=0, weight=0, value=0) kwargs = { "second_name": "Goblin", "stats": Stats(), "status": Status(), "weapon": sword } self.attacker = Goblin(first_name="Attacker", **deepcopy(kwargs)) self.defender = Goblin(first_name="Defender", **deepcopy(kwargs))
def create_status(self): """ :return: Status instance. """ return Status()
def test_contains(self): status = Status() effect = Block() status._effects = [effect] self.assertTrue(Block in status)
def test_is_not_blocking(self): status = Status() status._effects = [] self.assertFalse(status.is_blocking())
def test_is_blocking(self): status = Status() effect = Block() status._effects = [effect] self.assertTrue(status.is_blocking())
def test_does_not_contain(self): status = Status() status._effects = [] self.assertFalse(Block in status)