def test_change_for_speed(self): road = self.twoLaneRoad car = Car(road, (50, 0)) road.placeObject(car) self.assertTrue(car.willingToChangeDown()) self.assertFalse(car.willingToChangeUp())
def test_avoid_obstacle(self): road = self.twoLaneRoad car = Car(road, (89, 0), self.maxSpeed) road.placeObject(car) self.assertTrue(car.willingToChangeDown()) self.assertFalse(car.willingToChangeUp())
def test_change_because_car_ahead(self): road = self.threeLaneRoad car1, car2 = Car(road, (0, 1), 5), Car(road, (2, 1), 5) road.placeObjects( [car1, car2] ) self.assertTrue( car1.willingToChangeUp() and car1.willingToChangeDown() ) self.assertNotWillingToChange(car2)
def test_change_for_speed(self): road = self.twoLaneRoad car = Car(road, (50, 0)) road.placeObject(car) self.assertTrue( car.willingToChangeDown() ) self.assertFalse( car.willingToChangeUp() )
def test_avoid_obstacle(self): road = self.twoLaneRoad car = Car(road, (89, 0), self.maxSpeed) road.placeObject(car) self.assertTrue( car.willingToChangeDown() ) self.assertFalse( car.willingToChangeUp() )
def test_change_because_car_ahead(self): road = self.threeLaneRoad car1, car2 = Car(road, (0, 1), 5), Car(road, (2, 1), 5) road.placeObjects([car1, car2]) self.assertTrue(car1.willingToChangeUp() and car1.willingToChangeDown()) self.assertNotWillingToChange(car2)