From 95a0f20a9a6e7b3c4db3a381dd5b8b46d736ee00 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 28 Sep 2023 20:26:38 -0400 Subject: [PATCH] Make ZarrBIDSAsset to inherit from ZarrAsset first so iter_upload of Zarr is used not of a file Also fixed up test --- dandi/files/bids.py | 2 +- dandi/tests/test_upload.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dandi/files/bids.py b/dandi/files/bids.py index 8ab7c06c7..a875ba1cc 100644 --- a/dandi/files/bids.py +++ b/dandi/files/bids.py @@ -235,7 +235,7 @@ def get_metadata( ) -class ZarrBIDSAsset(BIDSAsset, ZarrAsset): +class ZarrBIDSAsset(ZarrAsset, BIDSAsset): """ .. versionadded:: 0.46.0 diff --git a/dandi/tests/test_upload.py b/dandi/tests/test_upload.py index 81f76866c..2d08200cb 100644 --- a/dandi/tests/test_upload.py +++ b/dandi/tests/test_upload.py @@ -295,10 +295,12 @@ def test_upload_zarr(new_dandiset: SampleDandiset) -> None: # identical to above, but different scenaior/fixture and path. TODO: avoid duplication def test_upload_bids_zarr(bids_zarr_dandiset: SampleDandiset) -> None: bids_zarr_dandiset.upload() - (asset,) = bids_zarr_dandiset.dandiset.get_assets() + assets = list(bids_zarr_dandiset.dandiset.get_assets()) + assert len(assets) > 10 # it is a bigish dataset + (asset,) = [a for a in assets if a.path.endswith(".zarr")] assert isinstance(asset, RemoteZarrAsset) assert asset.asset_type is AssetType.ZARR - assert asset.path == "sample.zarr" + assert asset.path.endswith(".zarr") # Test that uploading again without any changes works: bids_zarr_dandiset.upload()