本文整理汇总了Python中car.Car.calculate_slowdown方法的典型用法代码示例。如果您正苦于以下问题:Python Car.calculate_slowdown方法的具体用法?Python Car.calculate_slowdown怎么用?Python Car.calculate_slowdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类car.Car
的用法示例。
在下文中一共展示了Car.calculate_slowdown方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_car_that_has_looped_does_not_make_car_behind_slow_down
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import calculate_slowdown [as 别名]
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
示例2: test_car_does_not_slow_down
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import calculate_slowdown [as 别名]
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
示例3: test_car_that_has_looped_still_makes_car_behind_slow_down
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import calculate_slowdown [as 别名]
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
示例4: test_car_decides_to_slow_down
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import calculate_slowdown [as 别名]
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