Skip to content

Commit

Permalink
Merge pull request #1317 from zm711/rawio-tests
Browse files Browse the repository at this point in the history
Add test for get_rawio_class
  • Loading branch information
apdavison authored Sep 1, 2023
2 parents fc6d20e + 8a06aeb commit 354c8d9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions neo/test/rawiotest/test_get_rawio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from neo.rawio import get_rawio_class
from pathlib import Path
from tempfile import TemporaryDirectory


def test_get_rawio_class():
# use plexon io suffix for testing here
non_existant_file = Path('non_existant_folder/non_existant_file.plx')
non_existant_file.unlink(missing_ok=True)
ios = get_rawio_class(non_existant_file)

assert ios

# cleanup
non_existant_file.unlink(missing_ok=True)


def test_get_rawio_class_nonsupported_rawio():

non_existant_file = Path('non_existant_folder/non_existant_file.fake')
non_existant_file.unlink(missing_ok=True)
ios = get_rawio_class(non_existant_file)

assert ios is None

# cleanup
non_existant_file.unlink(missing_ok=True)

0 comments on commit 354c8d9

Please sign in to comment.