-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1317 from zm711/rawio-tests
Add test for get_rawio_class
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |