def setUp(self): self.ac = ac self.sameac = wc.AlyxClient( username='******', password='******', base_url='https://test.alyx.internationalbrainlab.org') self.sameac2 = wc.AlyxClient( username='******', password='******', base_url='https://test.alyx.internationalbrainlab.org')
def __init__(self, username=None, password=None, base_url=None, silent=False, printout=True): # get parameters override if inputs provided self._par = oneibl.params.get(silent=silent) self._par = self._par.set('ALYX_LOGIN', username or self._par.ALYX_LOGIN) self._par = self._par.set('ALYX_URL', base_url or self._par.ALYX_URL) self._par = self._par.set('ALYX_PWD', password or self._par.ALYX_PWD) try: self._alyxClient = wc.AlyxClient(username=self._par.ALYX_LOGIN, password=self._par.ALYX_PWD, base_url=self._par.ALYX_URL) except requests.exceptions.ConnectionError: raise ConnectionError( f"Can't connect to {self._par.ALYX_URL}.\n" + "IP addresses are filtered on IBL database servers. \n" + "Are you connecting from an IBL participating institution ?") # Init connection to Globus if needed # Display output when instantiating ONE if printout: print( f"Connected to {self._par.ALYX_URL} as {self._par.ALYX_LOGIN}", )
def setUp(self): # Init connection to the database self.ac = wc.AlyxClient( username='******', password='******', base_url='https://test.alyx.internationalbrainlab.org') self.test_data_uuid = '3ddd45be-7d24-4fc7-9dd3-a98717342af6'
def __init__(self, **kwargs): # get parameters override if inputs provided super(OneAlyx, self).__init__(**kwargs) try: self._alyxClient = wc.AlyxClient(username=self._par.ALYX_LOGIN, password=self._par.ALYX_PWD, base_url=self._par.ALYX_URL) # Display output when instantiating ONE print(f"Connected to {self._par.ALYX_URL} as {self._par.ALYX_LOGIN}", ) except requests.exceptions.ConnectionError: raise ConnectionError( f"Can't connect to {self._par.ALYX_URL}.\n" + "IP addresses are filtered on IBL database servers. \n" + "Are you connecting from an IBL participating institution ?" )
def __init__(self, username=None, password=None, base_url=None, silent=False): # get parameters override if inputs provided self._par = oneibl.params.get(silent=silent) self._par = self._par.set('ALYX_LOGIN', username or self._par.ALYX_LOGIN) self._par = self._par.set('ALYX_URL', base_url or self._par.ALYX_URL) self._par = self._par.set('ALYX_PWD', password or self._par.ALYX_PWD) # Init connection to the database try: self._alyxClient = wc.AlyxClient(username=self._par.ALYX_LOGIN, password=self._par.ALYX_PWD, base_url=self._par.ALYX_URL) except requests.exceptions.ConnectionError: raise ConnectionError("Can't connect to " + self._par.ALYX_URL + '. \n' + 'IP addresses are filtered on IBL database servers. \n' + 'Are you connecting from an IBL participating institution ?') print('Connected to ' + self._par.ALYX_URL + ' as ' + self._par.ALYX_LOGIN,)
import unittest import numpy as np import os import oneibl.webclient as wc import oneibl.params import tempfile import shutil par = oneibl.params.get() # Init connection to the database ac = wc.AlyxClient( username='******', password='******', base_url='https://test.alyx.internationalbrainlab.org') class TestSingletonPattern(unittest.TestCase): def setUp(self): self.ac = ac self.sameac = wc.AlyxClient( username='******', password='******', base_url='https://test.alyx.internationalbrainlab.org') self.differentac = wc.AlyxClient( username='******', password='******', base_url='https://testdev.alyx.internationalbrainlab.org') self.sameac2 = wc.AlyxClient( username='******', password='******', base_url='https://test.alyx.internationalbrainlab.org')