def test_send_async_command_session_not_found_in_lab(self):
        self._return_reserved()

        command = Command.Command("Your command")
        self.lab_mock.send_async_command(
            SessionId.SessionId('my_lab_session_id'), command)
        self.mocker.throw(
            LaboratoryErrors.SessionNotFoundInLaboratoryServerError(
                "problem@laboratory"))
        self.mocker.replay()

        self.create_reservation_processor()
        self.coordinator.confirmer._confirm_handler.join(10)
        self.assertFalse(self.coordinator.confirmer._confirm_handler.isAlive())

        self.reservation_processor.get_status()

        self.assertFalse(self.reservation_processor.is_expired())

        self.assertRaises(coreExc.NoCurrentReservationError,
                          self.reservation_processor.send_async_command,
                          command)

        self.assertEquals(self.reservation_processor.get_status().status,
                          Reservation.Reservation.POST_RESERVATION)
    def test_send_async_file_session_not_found_in_lab(self):
        self._return_reserved()

        file_content = "SAMPLE CONTENT"
        file_info = "program"
        self.lab_mock.send_async_file(SessionId.SessionId('my_lab_session_id'),
                                      file_content, file_info)
        self.mocker.throw(
            LaboratoryErrors.SessionNotFoundInLaboratoryServerError(
                "problem@laboratory"))
        self.mocker.replay()

        self.create_reservation_processor()
        self.coordinator.confirmer._confirm_handler.join(10)
        self.assertFalse(self.coordinator.confirmer._confirm_handler.isAlive())

        self.reservation_processor.get_status()

        self.assertFalse(self.reservation_processor.is_expired())

        self.assertRaises(coreExc.NoCurrentReservationError,
                          self.reservation_processor.send_async_file,
                          file_content, file_info)

        self.assertEquals(self.reservation_processor.get_status().status,
                          Reservation.Reservation.POST_RESERVATION)