def test_organism(): print(style(HEADER, "---Start: Organism Class checking---")) erron = 0 o = Organism() if (hasattr(o, "dmg") & hasattr(o, "hp")) == 0: print(style(WARNING, "Your organism class doesn't initialize properly")) return if o.hp != 35: erron += 1 print( style(FAIL, "You don't initialize" " the organism's ") + style(UNDERLINE, "hp") + end_style() + style(FAIL, " to ") + style(BOLD, "35") + end_style()) if o.dmg != 10: erron += 1 print( style(FAIL, "You don't initialize" " the organism's ") + style(UNDERLINE, "dmg") + end_style() + style(FAIL, " to ") + style(BOLD, "10") + end_style()) prev_hp = o.hp o.take_damage(10) if (prev_hp - o.hp) != 10: erron += 1 print( style(FAIL, "The ") + style(UNDERLINE, "take_damage") + end_style() + style(FAIL, " method, doesn't modify the hp properly")) if erron == 0: print(style(OKGREEN, "Organism Class, perfect."))