def test_set_average_speed_for_age_6(self): cat_1 = Cat(6) cat_2 = Cat(9) cat_3 = Cat(12) self.assertEqual(cat_1.average_speed, 12) self.assertEqual(cat_2.average_speed, 9) self.assertEqual(cat_3.average_speed, 6)
def test_run(self): cat_1 = Cat(6) cat_1.run(4) cat_2 = Cat(9) cat_2.run(7) self.assertEqual(cat_1.saturation_level, 45) self.assertEqual(cat_2.saturation_level, 35)
def setUp(self) -> None: self.passed_cats = [ Cat(1), Cat(7), Cat(8), Cat(10), Cat(12), Cat(15), ]
def test_cat_eat(age, food, result): cat = Cat(age) cat.eat(food) assert cat.get_saturation_level() == result
def test_cat_run(age, hours, result): cat = Cat(age) cat.run(hours) assert cat.get_saturation_level() == result
def test_set_cat_average_speed(age, result): cat = Cat(age) assert cat.get_average_speed() == result
def test_increase_saturation_level(self): cat_1 = Cat(1) cat_1._increase_saturation_level(50) self.assertEqual(cat_1.saturation_level, 100)
def test_eat_fodder(self): cat_1 = Cat(1) cat_1.eat('fodder') self.assertEqual(cat_1.saturation_level, 60) cat_2 = Cat(1) cat_2.eat('apple') self.assertEqual(cat_2.saturation_level, 55) cat_3 = Cat(1) cat_3.eat('milk') self.assertEqual(cat_3.saturation_level, 52)
def test_reduce_saturation_level_limit(self): cat_1 = Cat(1) cat_1._reduce_saturation_level(500) self.assertEqual(cat_1.saturation_level, 0)
def test_reduce_saturation_level(self): cat_1 = Cat(1) cat_1._reduce_saturation_level(40) self.assertEqual(cat_1.saturation_level, 10)