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