def _get_reserved(self):
        session_id = self.client.login('intstudent1', 'password')

        user_information = self.client.get_user_information(session_id)
        self.assertEquals( 'intstudent1', user_information.login) 
        self.assertEquals( 'Name of integration test 1', user_information.full_name)
        self.assertEquals( 'weblab@deusto.es', user_information.email)

        experiments = self.client.list_experiments(session_id)
        self.assertEquals( 2, len(experiments))

        dummy1_experiments = [ exp.experiment for exp in experiments if exp.experiment.name == 'dummy1' ]
        self.assertEquals( len(dummy1_experiments), 1)

        dummy1_experiment = dummy1_experiments[0]

        status = self.client.reserve_experiment(session_id, dummy1_experiment.to_experiment_id(), "{}", "{}")

        reservation_id = status.reservation_id

        # wait until it is reserved
        short_time = 0.1

        # Time extended from 9.0 to 15.0 because at times the test failed, possibly for that reason.
        times      = 15.0 / short_time

        while times > 0:
            new_status = self.client.get_reservation_status(reservation_id)
            if not isinstance(new_status, Reservation.WaitingConfirmationReservation) and not isinstance(new_status, Reservation.WaitingReservation):
                break
            times -= 1
            time.sleep(short_time)
        reservation = self.client.get_reservation_status(reservation_id)
        self.assertTrue(
                isinstance(reservation, Reservation.ConfirmedReservation),
                "Reservation %s is not Confirmed, as expected by this time" % reservation
            )
        return session_id, reservation_id
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/test/integration/general/test_no_concurrency.py/IntegrationNoConcurrencyTestCase._get_reserved/original