one.tests.util

Functions

caches_int2str

Convert int ids to str ids for cache tables

create_file_tree

Touch all the files in the datasets table

create_schema_cache

get_file

A stub function for iblutil.io.params.getfile.

revisions_datasets_table

set_up_env

Create a temporary directory and copy cache fixtures over

setup_rest_cache

Copy REST cache fixtures to the .one parameter directory

setup_test_params

set_up_env() → tempfile.TemporaryDirectory[source]

Create a temporary directory and copy cache fixtures over

Returns

Return type

TemporaryDirectory object

setup_rest_cache(param_dir=None)[source]

Copy REST cache fixtures to the .one parameter directory

create_file_tree(one)[source]

Touch all the files in the datasets table

setup_test_params(token=False)[source]
revisions_datasets_table(collections='', 'alf/probe00', 'alf/probe01', revisions='', '2020-01-08', '2021-07-06', object='spikes', attributes='times', 'waveforems')[source]
create_schema_cache(param_dir=None)[source]
get_file(root: str, str_id: str) → str[source]

A stub function for iblutil.io.params.getfile. Allows the injection of a different param dir.

Parameters
  • root (str, pathlib.Path) – The root directory of the new parameters

  • str_id (str) – The parameter string identifier

Returns

Return type

The parameter filename

caches_int2str(caches)[source]

Convert int ids to str ids for cache tables

Parameters

caches (Bunch) – A bunch of cache tables (from One._cache)

Returns

Return type

None