Skip to content

Commit

Permalink
Add tests for Intan files
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgill86 committed Dec 12, 2022
1 parent a5298b6 commit e131bfd
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
14 changes: 13 additions & 1 deletion neurotic/tests/metadata-for-tests.yml
Expand Up @@ -78,7 +78,19 @@ plain-text-axograph:
units: V
ylim: [-0.1, 5.1]

matlab example:
matlab-example:
data_dir: matlab-example
remote_data_dir: matlab-example
data_file: neo-matlab.mat

intan-example:
data_dir: intan-example
remote_data_dir: intan-example
data_file: intan-rhx-demo.rhd

plots: # TODO: make this example work without specifying "plots"
- channel: A-000
- channel: A-001
- channel: A-002
- channel: A-003
- channel: A-004
21 changes: 21 additions & 0 deletions neurotic/tests/test_gui.py
Expand Up @@ -86,5 +86,26 @@ def test_empty_plots(self):
# close thread properly
win.close()

def test_intan_lazy_loading(self):
"""Test creating an ephyviewer window for Intan with lazy loading"""
file = self.test_file
dataset = 'intan-example'
metadata = neurotic.MetadataSelector(file=file,
initial_selection=dataset)
metadata.download_all_data_files()

lazy=True
blk = neurotic.load_dataset(metadata=metadata, lazy=lazy)
ephyviewer_config = neurotic.EphyviewerConfigurator(metadata, blk,
lazy=lazy)
ephyviewer_config.show_all()

app = mkQApp()
win = ephyviewer_config.create_ephyviewer_window()
self.assertIsInstance(win, MainViewer)

# close thread properly
win.close()

if __name__ == '__main__':
unittest.main()
12 changes: 11 additions & 1 deletion neurotic/tests/test_neo_io.py
Expand Up @@ -74,7 +74,17 @@ def test_plain_text_axograph(self):

def test_matlab(self):
"""Test reading a MATLAB file"""
dataset = 'matlab example'
dataset = 'matlab-example'
metadata = neurotic.MetadataSelector(file=self.temp_file,
initial_selection=dataset)
metadata.download('data_file')

blk = neurotic.load_dataset(metadata=metadata, lazy=False)
assert(blk)

def test_intan(self):
"""Test reading an Intan file"""
dataset = 'intan-example'
metadata = neurotic.MetadataSelector(file=self.temp_file,
initial_selection=dataset)
metadata.download('data_file')
Expand Down

0 comments on commit e131bfd

Please sign in to comment.