def test_first_zero(self): owl = Owl("Pip", 10, 10) self.assertEqual(str(owl), "Owl [Pip, 10, 10, 0]") meat = Meat(4) self.assertEqual(owl.make_sound(), "Hoot Hoot") owl.feed(meat) veg = Vegetable(1) owl.feed(veg) self.assertEqual(owl.feed(veg), "Owl does not eat Vegetable!") self.assertEqual(str(owl), "Owl [Pip, 10, 11.0, 4]")
def test_can_instatiate_birds(): owl = Owl("Pip", 10, 10) print(owl) meat = Meat(4) print(owl.make_sound()) owl.feed(meat) veg = Vegetable(1) print(owl.feed(veg)) print(owl) hen = Hen("Harry", 10, 10) veg = Vegetable(3) fruit = Fruit(5) meat = Meat(1) print(hen) print(hen.make_sound()) hen.feed(veg) hen.feed(fruit) hen.feed(meat) print(hen)
kartof = Vegetable(3) meso = Meat(5) miki.feed(kartof) print(miki.feed(meso)) print(miki) gosheto = Dog("goshe", 20, "gruzia") print(gosheto) print(gosheto.feed(kartof)) gosheto.feed(meso) print(gosheto) owl = Owl("Pip", 10, 10) print(owl) meat = Meat(4) print(owl.make_sound()) owl.feed(meat) veg = Vegetable(1) print(owl.feed(veg)) print(owl) hen = Hen("Harry", 10, 10) veg = Vegetable(3) fruit = Fruit(5) meat = Meat(1) print(hen) print(hen.make_sound()) hen.feed(veg) hen.feed(fruit) hen.feed(meat) print(hen)