dandi.tests.fixtures#

Functions

bids_dandiset(new_dandiset, bids_examples)

bids_dandiset_invalid(new_dandiset, ...)

bids_error_examples(tmp_path_factory)

bids_examples(tmp_path_factory)

bids_nwb_dandiset(new_dandiset, bids_examples)

bids_zarr_dandiset(new_dandiset, bids_examples)

capture_all_logs(caplog)

docker_compose_setup()

get_filtered_gitrepo_fixture(url, whitelist)

get_gitrepo_fixture(url[, committish, ...])

local_dandi_api(docker_compose_setup)

new_dandiset(request, sample_dandiset_factory)

nwb_dandiset(new_dandiset, simple2_nwb)

nwb_test_data(tmp_path_factory)

nwbfiles_video_common(video_files)

Create nwbfiles sharing video files.

nwbfiles_video_unique(video_files)

Create nwbfiles linked with unique set of videos.

organized_nwb_dir(simple2_nwb, tmp_path_factory)

organized_nwb_dir2(simple1_nwb_metadata, ...)

organized_nwb_dir3(simple4_nwb, tmp_path_factory)

organized_nwb_dir4(simple4_nwb, simple5_nwb, ...)

Organized NWB directory with one file having one best practice violation, and another file having two best practice violations.

sample_dandiset_factory(local_dandi_api, ...)

simple1_nwb(simple1_nwb_metadata, ...)

simple1_nwb_metadata()

simple2_nwb(simple1_nwb_metadata, ...)

With a subject

simple3_nwb(simple1_nwb_metadata, ...)

With a subject, but no subject_id.

simple4_nwb(tmp_path_factory)

With subject, subject_id, species, but including data orientation ambiguity.

simple5_nwb(tmp_path_factory)

With subject, subject_id, species, but including data orientation ambiguity, and missing the pywnb.Timeseries unit attribute.

text_dandiset(new_dandiset)

tmp_home(monkeypatch, tmp_path_factory)

video_files(tmp_path)

zarr_dandiset(new_dandiset)

Classes

DandiAPI(api_key, client)

SampleDandiset(api, dspath, dandiset, ...)

SampleDandisetFactory(local_dandi_api, ...)

class dandi.tests.fixtures.DandiAPI(api_key: 'str', client: 'DandiAPIClient')[source]#
api_key: str#
property api_url: str#
client: DandiAPIClient#
property instance: DandiInstance#
property instance_id: str#
class dandi.tests.fixtures.SampleDandiset(api: 'DandiAPI', dspath: 'Path', dandiset: 'RemoteDandiset', dandiset_id: 'str', upload_kwargs: 'dict[str, Any]' = <factory>)[source]#
api: DandiAPI#
property client: DandiAPIClient#
dandiset: RemoteDandiset#
dandiset_id: str#
dspath: Path#
upload(paths: list[str | Path] | None = None, **kwargs: Any) None[source]#
upload_kwargs: dict[str, Any]#
class dandi.tests.fixtures.SampleDandisetFactory(local_dandi_api: 'DandiAPI', tmp_path_factory: 'pytest.TempPathFactory')[source]#
local_dandi_api: DandiAPI#
mkdandiset(name: str, embargo: bool = False) SampleDandiset[source]#
tmp_path_factory: TempPathFactory#
dandi.tests.fixtures.bids_dandiset(new_dandiset: SampleDandiset, bids_examples: Path) SampleDandiset[source]#
dandi.tests.fixtures.bids_dandiset_invalid(new_dandiset: SampleDandiset, bids_error_examples: Path) SampleDandiset[source]#
dandi.tests.fixtures.bids_error_examples(tmp_path_factory: pytest.TempPathFactory) Iterator[Path]#
dandi.tests.fixtures.bids_examples(tmp_path_factory: pytest.TempPathFactory) Iterator[Path]#
dandi.tests.fixtures.bids_nwb_dandiset(new_dandiset: SampleDandiset, bids_examples: Path) SampleDandiset[source]#
dandi.tests.fixtures.bids_zarr_dandiset(new_dandiset: SampleDandiset, bids_examples: Path) SampleDandiset[source]#
dandi.tests.fixtures.capture_all_logs(caplog: LogCaptureFixture) None[source]#
dandi.tests.fixtures.docker_compose_setup() Iterator[dict[str, str]][source]#
dandi.tests.fixtures.get_filtered_gitrepo_fixture(url: str, whitelist: list[str], make_subdirs_dandisets: bool | None = False) Callable[[pytest.TempPathFactory], Iterator[Path]][source]#
dandi.tests.fixtures.get_gitrepo_fixture(url: str, committish: str | None = None, scope: Scope = 'session', make_subdirs_dandisets: bool = False) Callable[[pytest.TempPathFactory], Path][source]#
dandi.tests.fixtures.local_dandi_api(docker_compose_setup: dict[str, str]) Iterator[DandiAPI][source]#
dandi.tests.fixtures.new_dandiset(request: FixtureRequest, sample_dandiset_factory: SampleDandisetFactory) SampleDandiset[source]#
dandi.tests.fixtures.nwb_dandiset(new_dandiset: SampleDandiset, simple2_nwb: Path) SampleDandiset[source]#
dandi.tests.fixtures.nwb_test_data(tmp_path_factory: TempPathFactory) Path#
dandi.tests.fixtures.nwbfiles_video_common(video_files: list[tuple[Path, Path]]) Path[source]#

Create nwbfiles sharing video files.

dandi.tests.fixtures.nwbfiles_video_unique(video_files: list[tuple[Path, Path]]) Path[source]#

Create nwbfiles linked with unique set of videos.

dandi.tests.fixtures.organized_nwb_dir(simple2_nwb: Path, tmp_path_factory: TempPathFactory) Path[source]#
dandi.tests.fixtures.organized_nwb_dir2(simple1_nwb_metadata: dict[str, Any], simple2_nwb: Path, tmp_path_factory: pytest.TempPathFactory) Path[source]#
dandi.tests.fixtures.organized_nwb_dir3(simple4_nwb: Path, tmp_path_factory: TempPathFactory) Path[source]#
dandi.tests.fixtures.organized_nwb_dir4(simple4_nwb: Path, simple5_nwb: Path, tmp_path_factory: TempPathFactory) Path[source]#

Organized NWB directory with one file having one best practice violation, and another file having two best practice violations.

dandi.tests.fixtures.sample_dandiset_factory(local_dandi_api: DandiAPI, tmp_path_factory: TempPathFactory) SampleDandisetFactory[source]#
dandi.tests.fixtures.simple1_nwb(simple1_nwb_metadata: dict[str, Any], tmp_path_factory: pytest.TempPathFactory) Path[source]#
dandi.tests.fixtures.simple1_nwb_metadata() dict[str, Any][source]#
dandi.tests.fixtures.simple2_nwb(simple1_nwb_metadata: dict[str, Any], tmp_path_factory: pytest.TempPathFactory) Path[source]#

With a subject

dandi.tests.fixtures.simple3_nwb(simple1_nwb_metadata: dict[str, Any], tmp_path_factory: pytest.TempPathFactory) Path[source]#

With a subject, but no subject_id.

dandi.tests.fixtures.simple4_nwb(tmp_path_factory: TempPathFactory) Path[source]#

With subject, subject_id, species, but including data orientation ambiguity.

dandi.tests.fixtures.simple5_nwb(tmp_path_factory: TempPathFactory) Path[source]#

With subject, subject_id, species, but including data orientation ambiguity, and missing the pywnb.Timeseries unit attribute.

Notes

dandi.tests.fixtures.text_dandiset(new_dandiset: SampleDandiset) SampleDandiset[source]#
dandi.tests.fixtures.tmp_home(monkeypatch: MonkeyPatch, tmp_path_factory: TempPathFactory) Path[source]#
dandi.tests.fixtures.video_files(tmp_path: Path) list[tuple[Path, Path]][source]#
dandi.tests.fixtures.zarr_dandiset(new_dandiset: SampleDandiset) SampleDandiset[source]#