Skip to content

Commit

Permalink
Add simple test for reading non-MIES files.
Browse files Browse the repository at this point in the history
  • Loading branch information
sheriferson committed Dec 13, 2023
1 parent 3739921 commit 9643dc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Binary file modified tests/data/nwb/Ctgf-T2A-dgCre;Ai14-495723.05.02.01.nwb
100755 → 100644
Binary file not shown.
17 changes: 14 additions & 3 deletions tests/test_nwb_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from ipfx.dataset.create import is_file_mies
from ipfx.dataset.create import is_file_mies, create_ephys_data_set

TEST_NWB_FILE_PATH = 'tests/data/nwb/Ctgf-T2A-dgCre;Ai14-495723.05.02.01.nwb'
TEST_MIES_FILE_PATH = 'tests/data/nwb/Ctgf-T2A-dgCre;Ai14-495723.05.02.01.nwb'
TEST_NON_MIES_FILE_PATH = 'tests/data/2018_03_20_0005.nwb'

def test_is_file_mies():
assert is_file_mies(TEST_NWB_FILE_PATH) == True
assert is_file_mies(TEST_MIES_FILE_PATH) == True

def test_is_file_mies_with_non_mies_file():
"""
Tests the case where the file is not detected as a MIES file.
The file is read using the ipfx.dataset.hbg_nwb_data.HBGNWBData class.
"""
assert is_file_mies(TEST_NON_MIES_FILE_PATH) == False
nwb_data = create_ephys_data_set(TEST_NON_MIES_FILE_PATH)
assert nwb_data is not None
assert len(nwb_data.ontology.stimuli) > 0

0 comments on commit 9643dc1

Please sign in to comment.