ibllib.tests.test_oneibl

Functions

get_mock_session_settings

Create a basic session settings file for testing.

Classes

TestAlyx2Path

TestDataHandlers

Tests for ibllib.oneibl.data_handlers.DataHandler classes.

TestFTPPatcher

TestGlobusPatcher

Tests for the ibllib.oneibl.patcher.GlobusPatcher class.

TestRegistration

TestRegistrationEndpoint

TestUtils

Test helper functions in ibllib.oneibl.registration module.

class TestUtils(methodName='runTest')[source]

Bases: TestCase

Test helper functions in ibllib.oneibl.registration module.

test_get_lab()[source]

Test ibllib.oneibl.registration.get_lab function.

class TestFTPPatcher(methodName='runTest')[source]

Bases: TestCase

setUp() None[source]

Hook method for setting up the test fixture before exercising it.

reset_params()[source]

Remove the FTP parameters from the AlyxClient

test_setup(_)[source]
static mock_input(prompt)[source]
class TestGlobusPatcher(methodName='runTest')[source]

Bases: TestCase

Tests for the ibllib.oneibl.patcher.GlobusPatcher class.

globus_sdk_mock = None

Mock object for globus_sdk package.

Type:

unittest.mock._patch

setUp(_) None[source]

Hook method for setting up the test fixture before exercising it.

test_patch_datasets()[source]

Tests for GlobusPatcher.patch_datasets and GlobusPatcher.launch_transfers methods.

class TestAlyx2Path(methodName='runTest')[source]

Bases: TestCase

dset = {'collection': 'alf/probe00', 'file_records': [{'data_repository': 'ibl_floferlab_SR', 'data_repository_path': '/mnt/s0/Data/Subjects/', 'data_url': None, 'exists': True, 'id': 'c9ae1b6e-03a6-41c9-9e1b-4a7f9b5cfdbf', 'relative_path': 'SWC_014/2019-12-11/001/alf/probe00/channels.localCoordinates.npy'}, {'data_repository': 'flatiron_hoferlab', 'data_repository_path': '/hoferlab/Subjects/', 'data_url': 'https://ibl.flatironinstitute.org/hoferlab/Subjects/SWC_014/2019-12-11/001/alf/probe00/channels.localCoordinates.00059298-1b33-429c-a802-fa51bb662d72.npy', 'exists': True, 'id': 'f434a638-bc61-4695-884e-70fd1e521d60', 'relative_path': 'SWC_014/2019-12-11/001/alf/probe00/channels.localCoordinates.npy'}], 'name': 'channels.localCoordinates.npy', 'session': 'https://alyx.internationalbrainlab.org/sessions/7cffad38-0f22-4546-92b5-fd6d2e8b2be9', 'url': 'https://alyx.internationalbrainlab.org/datasets/00059298-1b33-429c-a802-fa51bb662d72'}
test_dsets_2_path()[source]
get_mock_session_settings(subject='clns0730', user='test_user')[source]

Create a basic session settings file for testing.

class TestRegistrationEndpoint(methodName='runTest')[source]

Bases: TestCase

test_task_names_extractors()[source]

This is to test against regressions

class TestRegistration(methodName='runTest')[source]

Bases: TestCase

subject = ''

The name of the subject under which to create sessions.

Type:

str

one = None

An instance of ONE connected to a test database.

Type:

one.api.OneAlyx

classmethod setUpClass()[source]

Create a random new subject.

setUp() None[source]

Hook method for setting up the test fixture before exercising it.

test_registration_datasets()[source]
test_create_sessions()[source]
test_registration_session()[source]
test_register_chained_session()[source]

Tests for registering a session with chained (multiple) protocols

tearDown() None[source]

Hook method for deconstructing the test fixture after testing it.

classmethod tearDownClass() None[source]

Hook method for deconstructing the class fixture after running all tests in the class.

class TestDataHandlers(methodName='runTest')[source]

Bases: TestCase

Tests for ibllib.oneibl.data_handlers.DataHandler classes.

test_server_upload_data(register_dataset_mock)[source]

A test for ServerDataHandler.uploadData method.