def test_get_vehicle_number_for_driver_age(self): text1 = "Create_parking_lot 6" text2 = "Park AA-11-BB-2222 driver_age 20" text3 = "Vehicle_registration_number_for_driver_of_age 18" text4 = "Vehicle_registration_number_for_driver_of_age 20" text5 = "Vehicle_registration_number_for_driver_of_age 20a" t, res1 = transport.create_parking_lot(text1.split(" "), False) res2 = transport.parking_a_car(text2.split(" ")) res3 = transport.get_vehicle_number_for_driver_age(text3.split(" ")) self.assertEqual([], res3) res4 = transport.get_vehicle_number_for_driver_age(text4.split(" ")) self.assertEqual(['AA-11-BB-2222'], res4) with self.assertRaises(SquadException): transport.get_slot_numbers_with_driver_age(text5.split(" ")) service.drop_tables()
def test_leave(self): text1 = "Create_parking_lot 6" text2 = "Park AA-11-BB-2222 driver_age 20" text3 = "Leave a" text4 = "Leave 0" text5 = "Leave 2" text6 = "Leave 1" t, res1 = transport.create_parking_lot(text1.split(" "), False) res2 = transport.parking_a_car(text2.split(" ")) with self.assertRaises(SquadException): transport.leave_slot(text3.split(" ")) with self.assertRaises(SquadException): transport.leave_slot(text4.split(" ")) self.assertEqual(Response.SlotAlreadyVacant, transport.leave_slot(text5.split(" "))) res6 = transport.leave_slot(text6.split(" ")) self.assertEqual(Response.LeaveResponse.format(1, "AA-11-BB-2222", 20), res6)
def test_create_parking_lot_1(self): with self.assertRaises(SquadException): transport.create_parking_lot(" ", True) service.drop_tables()