Skip to content

Commit 8a06aeb

Browse files
committed
add test for get_rawio_class
1 parent fc6d20e commit 8a06aeb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from neo.rawio import get_rawio_class
2+
from pathlib import Path
3+
from tempfile import TemporaryDirectory
4+
5+
6+
def test_get_rawio_class():
7+
# use plexon io suffix for testing here
8+
non_existant_file = Path('non_existant_folder/non_existant_file.plx')
9+
non_existant_file.unlink(missing_ok=True)
10+
ios = get_rawio_class(non_existant_file)
11+
12+
assert ios
13+
14+
# cleanup
15+
non_existant_file.unlink(missing_ok=True)
16+
17+
18+
def test_get_rawio_class_nonsupported_rawio():
19+
20+
non_existant_file = Path('non_existant_folder/non_existant_file.fake')
21+
non_existant_file.unlink(missing_ok=True)
22+
ios = get_rawio_class(non_existant_file)
23+
24+
assert ios is None
25+
26+
# cleanup
27+
non_existant_file.unlink(missing_ok=True)

0 commit comments

Comments
 (0)