def test_car_that_has_looped_does_not_make_car_behind_slow_down(): car1 = Car() car2 = Car() car1.speed = 25 car2.speed = 27 car1.location = 15 car2.location = 980 assert car2.calculate_slowdown(car1) == False
def test_car_does_not_slow_down(): car1 = Car() car2 = Car() car1.speed = 25 car2.speed = 27 car1.location = 115 car2.location = 80 assert car2.calculate_slowdown(car1) == False
def test_car_that_has_looped_still_makes_car_behind_slow_down(): car1 = Car() car2 = Car() car1.speed = 25 car2.speed = 27 car1.location = 2 car2.location = 980 assert car2.calculate_slowdown(car1) == True
def test_car_decides_to_slow_down(): car1 = Car() car2 = Car() car1.speed = 25 car2.speed = 27 car1.location = 100 car2.location = 80 assert car2.calculate_slowdown(car1) == True