def park(_, registration_number, color): car = Car(registration_number, color) car.set_driver(Driver()) try: parking.get_manager().park(car) print("Allocated slot number: %d" % parking.get_manager().get_slot_of(car).get_serial_number()) except ParkingFullError: print("Sorry, parking lot is full")
def test_car_driver(self): # Given car = Car("KA-01-HH-2701", "Red") driver = Driver() # When car.set_driver(driver) # Then self.assertEqual(car.get_driver(), driver)