from solution import Vehicle, ParkingLot
def test_parking_lot_basic():
print("Running basic parking tests...")
lot = ParkingLot(2)
v1 = Vehicle("V1")
v2 = Vehicle("V2")
v3 = Vehicle("V3")
assert lot.get_available_spots() == 2
assert lot.park_vehicle(v1) is True
assert lot.get_available_spots() == 1
assert lot.park_vehicle(v2) is True
assert lot.get_available_spots() == 0
assert lot.park_vehicle(v3) is False # no space
print("✅ Basic parking tests passed")
def test_unpark():
print("Running unpark tests...")
lot = ParkingLot(2)
v1 = Vehicle("V1")
v2 = Vehicle("V2")
lot.park_vehicle(v1)
lot.park_vehicle(v2)
assert lot.unpark_vehicle("V1") is True
assert lot.get_available_spots() == 1
assert lot.unpark_vehicle("V1") is False # already removed
assert lot.unpark_vehicle("UNKNOWN") is False
print("✅ Unpark tests passed")
def test_duplicate_vehicle():
print("Running duplicate vehicle tests...")
lot = ParkingLot(2)
v1 = Vehicle("V1")
assert lot.park_vehicle(v1) is True
assert lot.park_vehicle(v1) is False # same vehicle again
print("✅ Duplicate vehicle tests passed")
if __name__ == "__main__":
test_parking_lot_basic()
test_unpark()
test_duplicate_vehicle()
print("\n🎉 ALL DAY 7 TESTS PASSED SUCCESSFULLY")