Ejemplo n.º 1
0
    def sub_not_ok(self):
        lift1 = Elevator(1)
        lift2 = Elevator(2)

        for _ in range(5):
            lift2.lift()
        try:
            result = lift1 - lift2
            print('Test not Ok', result)
        except IncorrectOperation:
            print('Test Ok')
Ejemplo n.º 2
0
 def take_inv(self, base):
     base: "Base"
     from lift import Elevator
     while not Elevator().validate_inv(self):
         cur_inv = base.give_inv(self)
         if cur_inv is None:
             break
         self.using_inv.append(cur_inv)
Ejemplo n.º 3
0
    def lt_ok(self):
        lift1 = Elevator(1)
        lift2 = Elevator(2)

        for _ in range(5):
            lift1.lift()
        for _ in range(10):
            lift2.lift()

        if lift1 < lift2:
            print('Test Ok')
        else:
            print('Test not Ok')
Ejemplo n.º 4
0
    def lift_ok(self):
        lift1 = Elevator(1)
        lift2 = Elevator(2)

        for _ in range(10):
            lift1.lift()
        for _ in range(5):
            lift2.lift()

        if lift1.call == 10 and lift2.call == 5:
            print('Test Ok')
        else:
            print('Test not Ok')
Ejemplo n.º 5
0
    def total_call_ok(self):
        lift1 = Elevator(1)
        lift2 = Elevator(2)

        for _ in range(30):
            lift1.lift()
        for _ in range(12):
            lift2.lift()

        if Elevator.total_call == 42:
            print('Test Ok')
        else:
            print('Test not Ok')