Skip to content

Commit

Permalink
improved bids upload testing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChymera committed Jul 5, 2022
1 parent 4847cbb commit 9f82246
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion dandi/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ def zarr_dandiset(new_dandiset: SampleDandiset) -> SampleDandiset:

@pytest.fixture()
def bids_dandiset(new_dandiset: SampleDandiset, bids_examples: str) -> SampleDandiset:

shutil.copytree(
os.path.join(bids_examples, "asl003"),
os.path.join(str(new_dandiset.dspath), "asl003"),
Expand Down
8 changes: 4 additions & 4 deletions dandi/tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def test_upload_sync_folder(
text_dandiset.dandiset.get_asset_by_path("subdir2/banana.txt")


def test_upload_sync_bids(mocker, bids_dandiset):
confirm_mock = mocker.patch("click.confirm", return_value=True)
bids_dandiset.upload()
confirm_mock.assert_called_with("Delete 1 asset on server?")
def test_upload_bids(mocker: MockerFixture, bids_dandiset: SampleDandiset) -> None:
iter_upload_spy = mocker.spy(LocalFileAsset, "iter_upload")
bids_dandiset.upload(existing="forced")
iter_upload_spy.assert_called()


def test_upload_sync_zarr(mocker, zarr_dandiset):
Expand Down

0 comments on commit 9f82246

Please sign in to comment.