one.tests.test_alyxrest

Unit tests for Alyx REST queries using the AlyxClient.rest method.

Classes

TestREST

Tests for AlyxClient.rest method and remote Alyx REST interactions.

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

Bases: TestCase

Tests for AlyxClient.rest method and remote Alyx REST interactions.

EID = 'cf264653-2deb-44cb-aa84-89b82507028a'
EID_EPHYS = 'b1c968ad-4874-468d-b2e4-5ffa9b9964e9'
alyx = None
classmethod setUpClass() None[source]

Hook method for setting up class fixture before running tests in the class.

test_paginated_request()[source]

Check that paginated response object is returned upon making large queries.

test_generic_request()[source]

Test AlyxClient.get method.

test_rest_endpoint_write()[source]

Test create and delete actions in AlyxClient.rest method.

test_rest_endpoint_read_only()[source]

Test list and read actions in AlyxClient.rest method.

test_rest_all_actions()[source]

Test for AlyxClient.rest method using subjects endpoint

test_endpoints_docs()[source]

Test for AlyxClient.list_endpoints method and AlyxClient.rest

test_print_endpoint_info()[source]

Test endpoint query params are printed when calling AlyxClient.rest without action.

test_water_restriction()[source]

Test listing water-restriction endpoint.

Examples of how to list all water restrictions and water-restriction for a given subject.

test_list_pk_query()[source]

Test REST list with id keyword argument.

It’s a bit stupid but the REST endpoint can’t forward a direct query of the uuid via the pk keyword. The AlyxClient has already an id parameter, which on the list method is used as a pk identifier. This special case is tested here.

test_note_with_picture_upload()[source]

Test adding session note with attached picture.

test_channels()[source]

Test creation of insertion, trajectory and channels.