def check_incoming_close_lease(self, request: ABCAuthorityReservation, incoming: ABCReservationMixin): self.assertIsNotNone(incoming) rset = incoming.get_resources() self.assertIsNotNone(rset) self.assertEqual(request.get_requested_units(), rset.get_units()) uset = rset.get_resources() self.assertIsNotNone(uset) self.assertEqual(0, uset.get_units())
def check_incoming_extend_lease(self, request: ABCAuthorityReservation, incoming: ABCReservationMixin): self.assertIsNotNone(incoming) self.assertEqual(ReservationStates.Active, incoming.get_state()) self.assertEqual(ReservationPendingStates.None_, incoming.get_pending_state()) rset = incoming.get_resources() self.assertIsNotNone(rset) self.assertEqual(request.get_requested_units(), rset.get_units()) self.assertEqual(incoming.get_term(), request.get_requested_term()) uset = rset.get_resources() self.assertIsNotNone(uset) self.assertEqual(self.TicketUnits, uset.get_units()) u = uset.get_set().values().__iter__().__next__() self.assertEqual(self.my_unit, u)
def check_incoming_lease(self, request: ABCAuthorityReservation, incoming: ABCReservationMixin): self.assertIsNotNone(incoming) rset = incoming.get_resources() self.assertIsNotNone(rset) self.assertEqual(request.get_requested_units(), rset.get_units()) self.assertEqual(incoming.get_term(), request.get_requested_term()) uset = rset.get_resources() self.assertIsNotNone(uset) self.assertEqual(self.TicketUnits, uset.get_units()) u = uset.get_set().values().__iter__().__next__() self.my_unit = u