def testFind2(self): pr1 = PassengersRepo() pr2 = PlaneRepo() ctrl = Controller(pr2, pr1) p1 = Passengers('Ion', 'C', 'abc') p2 = Passengers('Ioana', 'B', 'abc2') p3 = Planes('Nume', 'A101', 'Wizair', 60, 'Cairo', [p1, p2]) ctrl.addPlane(p3) p4 = Passengers('Ion', 'A', 'abc22') p5 = Passengers('Andrei', 'B', 'adc44') p6 = Planes('Nume1', 'A202', 'Wizz', 60, 'Cairo', [p4, p5]) ctrl.addPlane(p6)
def testSort3(self): pr1 = PassengersRepo() pr2 = PlaneRepo() ctrl = Controller(pr2, pr1) p1 = Passengers('Ion', 'C', '1') p2 = Passengers('Ioana', 'B', '1') p3 = Planes('Nume', 'A101', 'Wizair', 60, 'Cairo', [p1, p2]) ctrl.addPlane(p3) p4 = Passengers('Ion', 'A', '1') p6 = Planes('Nume1', 'A202', 'Wizz', 1, 'Cairo', [p4]) ctrl.addPlane(p6) ctrl.sortwithconcatenation() self.assertEqual(ctrl.getPlanesforTest(), [p6, p3])
def testSort2(self): pr1 = PassengersRepo() pr2 = PlaneRepo() ctrl = Controller(pr2, pr1) p1 = Passengers('Ion', 'C', '1') p2 = Passengers('Ioana', 'B', '2') p3 = Planes('Nume', 'A101', 'Wizair', 60, 'Cairo', [p1, p2]) ctrl.addPlane(p3) p4 = Passengers('Ion', 'A', '1') p5 = Passengers('Andrei', 'B', '2') p6 = Planes('Nume1', 'A202', 'Wizz', 60, 'Cairo', [p4, p5]) ctrl.addPlane(p6) ctrl.sortwithletter('I') self.assertEqual(ctrl.getPlanesforTest(), [p6, p3])
def testSort1(self): pr1 = PassengersRepo() pr2 = PlaneRepo() ctrl = Controller(pr2, pr1) p1 = Passengers('Ion', 'C', '1') p2 = Passengers('Ioana', 'B', '2') p3 = Planes('Nume', 'A101', 'Wizair', 60, 'Cairo', [p1, p2]) ctrl.addPlane(p3) p4 = Passengers('Ion', 'A', '1') p5 = Passengers('Ioana', 'B', '2') p6 = Planes('Nume1', 'A202', 'Wizz', 60, 'Cairo', [p4, p5]) ctrl.addPlane(p6) ctrl.sortbyLastName() self.assertEqual(ctrl.getPlanes()[0].getPassengers(), [p2, p1]) self.assertEqual(ctrl.getPlanes()[1].getPassengers(), [p4, p5])
def testBT2(self): pr1 = PassengersRepo() pr2 = PlaneRepo() ctrl = Controller(pr2, pr1) p1 = Passengers('Ion', 'C', 'abc') p2 = Passengers('Ioana', 'B', 'abc2') p3 = Planes('Nume1', 'A201', 'Wizair', 60, 'Cairo', [p1, p2]) ctrl.addPlane(p3) p4 = Passengers('Ion', 'A', 'abc22') p5 = Passengers('Andrei', 'B', 'adc44') p6 = Planes('Nume2', 'A202', 'Wizair', 60, 'Cairo', [p4, p5]) ctrl.addPlane(p6) p7 = Planes('Nume3', 'A203', 'Wair', 60, 'Cairo', [p4, p5]) ctrl.addPlane(p7) p8 = Planes('Nume4', 'A204', 'Wizair', 60, 'Cairo', [p4, p5]) ctrl.addPlane(p8) l1 = ctrl.form2(2)