Skip to content

Commit 354c8d9

Browse files
authored
Merge pull request #1317 from zm711/rawio-tests
Add test for get_rawio_class
2 parents fc6d20e + 8a06aeb commit 354c8d9

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)