From 39601b0c9ee0b28e816b6141fc44f23193e957e0 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:08:43 -0400 Subject: [PATCH] simply with pytest param --- dandi/tests/test_organize.py | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/dandi/tests/test_organize.py b/dandi/tests/test_organize.py index 068e1fa81..ece50b8fe 100644 --- a/dandi/tests/test_organize.py +++ b/dandi/tests/test_organize.py @@ -110,7 +110,8 @@ def c() -> Any: # shortcut @pytest.mark.integration @pytest.mark.parametrize("mode", no_move_modes) -def test_organize_nwb_test_data(nwb_test_data: Path, tmp_path: Path, mode: str) -> None: +@pytest.mark.parametrize("jobs", (1, None)) +def test_organize_nwb_test_data(nwb_test_data: Path, tmp_path: Path, mode: str, jobs: int) -> None: outdir = tmp_path / "organized" relative = False @@ -152,7 +153,7 @@ def test_organize_nwb_test_data(nwb_test_data: Path, tmp_path: Path, mode: str) input_files = nwb_test_data / "v2.0.1" - cmd = ["-d", str(outdir), "--files-mode", mode, str(input_files)] + cmd = ["-d", str(outdir), "--files-mode", mode, str(input_files), "--jobs", str(jobs)] r = CliRunner().invoke(organize, cmd) # with @map_to_click_exceptions we loose original str of message somehow @@ -387,21 +388,3 @@ def test_organize_required_field(simple2_nwb: Path, tmp_path: Path) -> None: tmp_path / dandiset_metadata_file, tmp_path / "sub-mouse001" / "sub-mouse001_ses-session-id1.nwb", ] - - -def test_organize_single_job(simple2_nwb: Path, tmp_path: Path) -> None: - (tmp_path / dandiset_metadata_file).write_text("{}\n") - r = CliRunner().invoke( - organize, - [ - "--dandiset-path", - str(tmp_path), - "--jobs", - "1", - ], - ) - assert r.exit_code == 0 - assert list_paths(tmp_path) == [ - tmp_path / dandiset_metadata_file, - tmp_path / "sub-mouse001" / "sub-mouse001_ses-session-id1.nwb", - ]