File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+ from tempfile import TemporaryDirectory
3+ from neo .io import get_io , list_candidate_ios , NixIO
4+
5+
6+ def test_list_candidate_ios_non_existant_file ():
7+ # use plexon io suffix for testing here
8+ non_existant_file = 'non_existant_folder/non_existant_file.plx'
9+ ios = list_candidate_ios (non_existant_file )
10+
11+ assert ios
12+
13+
14+ def test_list_candidate_ios_filename_stub ():
15+ # create dummy folder with dummy files
16+ with TemporaryDirectory (prefix = 'filename_stub_test_' ) as test_folder :
17+ test_folder = Path (test_folder )
18+ test_filename = (test_folder / 'dummy_file.nix' )
19+ test_filename .touch ()
20+ filename_stub = test_filename .with_suffix ('' )
21+
22+ # check that io is found even though file suffix was not provided
23+ ios = list_candidate_ios (filename_stub )
24+
25+ assert NixIO in ios
26+
27+
28+ def test_get_io_non_existant_file_writable_io ():
29+ # use nixio for testing with writable io
30+ non_existant_file = 'non_existant_file.nix'
31+ io = get_io (non_existant_file )
32+
33+ assert isinstance (io , NixIO )
You can’t perform that action at this time.
0 commit comments