Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Mar 9, 2022
1 parent 237c3e3 commit cb160b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dandi/tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DandisetMetadataFile,
GenericAsset,
NWBAsset,
VideoAsset,
ZarrAsset,
dandi_file,
find_dandi_files,
Expand All @@ -36,6 +37,7 @@ def test_find_dandi_files(tmp_path: Path) -> None:
(tmp_path / "subdir" / "gnusto").touch()
(tmp_path / "subdir" / "cleesh.txt").touch()
(tmp_path / "empty.zarr").mkdir()
(tmp_path / "glarch.mp4").touch()
(tmp_path / ".ignored").touch()
(tmp_path / ".ignored.dir").mkdir()
(tmp_path / ".ignored.dir" / "ignored.nwb").touch()
Expand All @@ -44,6 +46,7 @@ def test_find_dandi_files(tmp_path: Path) -> None:
find_dandi_files(tmp_path, dandiset_path=tmp_path), key=attrgetter("filepath")
)
assert files == [
VideoAsset(filepath=tmp_path / "glarch.mp4", path="glarch.mp4"),
ZarrAsset(filepath=tmp_path / "sample01.zarr", path="sample01.zarr"),
NWBAsset(filepath=tmp_path / "sample02.nwb", path="sample02.nwb"),
NWBAsset(
Expand All @@ -62,6 +65,7 @@ def test_find_dandi_files(tmp_path: Path) -> None:
GenericAsset(filepath=tmp_path / "bar.txt", path="bar.txt"),
DandisetMetadataFile(filepath=tmp_path / dandiset_metadata_file),
GenericAsset(filepath=tmp_path / "foo", path="foo"),
VideoAsset(filepath=tmp_path / "glarch.mp4", path="glarch.mp4"),
ZarrAsset(filepath=tmp_path / "sample01.zarr", path="sample01.zarr"),
NWBAsset(filepath=tmp_path / "sample02.nwb", path="sample02.nwb"),
GenericAsset(
Expand All @@ -82,6 +86,7 @@ def test_find_dandi_files(tmp_path: Path) -> None:
)
assert files == [
DandisetMetadataFile(filepath=tmp_path / dandiset_metadata_file),
VideoAsset(filepath=tmp_path / "glarch.mp4", path="glarch.mp4"),
ZarrAsset(filepath=tmp_path / "sample01.zarr", path="sample01.zarr"),
NWBAsset(filepath=tmp_path / "sample02.nwb", path="sample02.nwb"),
NWBAsset(
Expand Down

0 comments on commit cb160b6

Please sign in to comment.