1111import numpy as np
1212from numpy .testing import assert_equal
1313import quantities as pq
14-
14+ from neo . test . rawiotest . test_axographrawio import TestAxographRawIO
1515
1616class TestAxographIO (BaseTestIO , unittest .TestCase ):
17- files_to_test = [
18- 'AxoGraph_Graph_File' , # version 1 file, provided with AxoGraph
19- 'AxoGraph_Digitized_File' , # version 2 file, provided with AxoGraph
20- 'AxoGraph_X_File.axgx' , # version 5 file, provided with AxoGraph
21- 'File_axograph.axgd' , # version 6 file
22- 'episodic.axgd' ,
23- 'events_and_epochs.axgx' ,
24- 'written-by-axographio-with-linearsequence.axgx' ,
25- 'written-by-axographio-without-linearsequence.axgx' ,
26- 'corrupt-comment.axgx' ,
17+ entities_to_download = [
18+ 'axograph'
2719 ]
28- files_to_download = files_to_test
20+ entities_to_test = TestAxographRawIO . entities_to_test
2921 ioclass = AxographIO
3022
3123 def test_version_1 (self ):
3224 """Test reading a version 1 AxoGraph file"""
3325
34- filename = self .get_filename_path ( ' AxoGraph_Graph_File' )
26+ filename = self .get_local_path ( 'axograph/ AxoGraph_Graph_File' )
3527 reader = AxographIO (filename = filename )
3628 blk = reader .read_block (signal_group_mode = 'split-all' )
3729 assert_equal (blk .annotations ['format_ver' ], 1 )
@@ -55,7 +47,7 @@ def test_version_1(self):
5547 def test_version_2 (self ):
5648 """Test reading a version 2 AxoGraph file"""
5749
58- filename = self .get_filename_path ( ' AxoGraph_Digitized_File' )
50+ filename = self .get_local_path ( 'axograph/ AxoGraph_Digitized_File' )
5951 reader = AxographIO (filename = filename )
6052 blk = reader .read_block (signal_group_mode = 'split-all' )
6153 assert_equal (blk .annotations ['format_ver' ], 2 )
@@ -85,7 +77,7 @@ def test_version_2(self):
8577 def test_version_5 (self ):
8678 """Test reading a version 5 AxoGraph file"""
8779
88- filename = self .get_filename_path ( ' AxoGraph_X_File.axgx' )
80+ filename = self .get_local_path ( 'axograph/ AxoGraph_X_File.axgx' )
8981 reader = AxographIO (filename = filename )
9082 blk = reader .read_block (signal_group_mode = 'split-all' )
9183 assert_equal (blk .annotations ['format_ver' ], 5 )
@@ -109,7 +101,7 @@ def test_version_5(self):
109101 def test_version_6 (self ):
110102 """Test reading a version 6 AxoGraph file"""
111103
112- filename = self .get_filename_path ( ' File_axograph.axgd' )
104+ filename = self .get_local_path ( 'axograph/ File_axograph.axgd' )
113105 reader = AxographIO (filename = filename )
114106 blk = reader .read_block (signal_group_mode = 'split-all' )
115107 assert_equal (blk .annotations ['format_ver' ], 6 )
@@ -133,7 +125,7 @@ def test_version_6(self):
133125 def test_file_written_by_axographio_package_with_linearsequence (self ):
134126 """Test reading file written by axographio package with linearsequence time column"""
135127
136- filename = self .get_filename_path ( ' written-by-axographio-with-linearsequence.axgx' )
128+ filename = self .get_local_path ( 'axograph/ written-by-axographio-with-linearsequence.axgx' )
137129 reader = AxographIO (filename = filename )
138130 blk = reader .read_block (signal_group_mode = 'split-all' )
139131 assert_equal (blk .annotations ['format_ver' ], 6 )
@@ -157,7 +149,7 @@ def test_file_written_by_axographio_package_with_linearsequence(self):
157149 def test_file_written_by_axographio_package_without_linearsequence (self ):
158150 """Test reading file written by axographio package without linearsequence time column"""
159151
160- filename = self .get_filename_path ( ' written-by-axographio-without-linearsequence.axgx' )
152+ filename = self .get_local_path ( 'axograph/ written-by-axographio-without-linearsequence.axgx' )
161153 reader = AxographIO (filename = filename )
162154 blk = reader .read_block (signal_group_mode = 'split-all' )
163155 assert_equal (blk .annotations ['format_ver' ], 6 )
@@ -181,7 +173,7 @@ def test_file_written_by_axographio_package_without_linearsequence(self):
181173 def test_file_with_corrupt_comment (self ):
182174 """Test reading a file with a corrupt comment"""
183175
184- filename = self .get_filename_path ( ' corrupt-comment.axgx' )
176+ filename = self .get_local_path ( 'axograph/ corrupt-comment.axgx' )
185177 reader = AxographIO (filename = filename )
186178 blk = reader .read_block (signal_group_mode = 'split-all' )
187179 assert_equal (blk .annotations ['format_ver' ], 6 )
@@ -205,7 +197,7 @@ def test_file_with_corrupt_comment(self):
205197 def test_multi_segment (self ):
206198 """Test reading an episodic file into multiple Segments"""
207199
208- filename = self .get_filename_path ( ' episodic.axgd' )
200+ filename = self .get_local_path ( 'axograph/ episodic.axgd' )
209201 reader = AxographIO (filename = filename )
210202 blk = reader .read_block (signal_group_mode = 'split-all' )
211203
@@ -228,7 +220,7 @@ def test_multi_segment(self):
228220 def test_force_single_segment (self ):
229221 """Test reading an episodic file into one Segment"""
230222
231- filename = self .get_filename_path ( ' episodic.axgd' )
223+ filename = self .get_local_path ( 'axograph/ episodic.axgd' )
232224 reader = AxographIO (filename = filename , force_single_segment = True )
233225 blk = reader .read_block (signal_group_mode = 'split-all' )
234226
@@ -251,7 +243,7 @@ def test_force_single_segment(self):
251243 def test_group_by_same_units (self ):
252244 """Test reading with group-by-same-units"""
253245
254- filename = self .get_filename_path ( ' episodic.axgd' )
246+ filename = self .get_local_path ( 'axograph/ episodic.axgd' )
255247 reader = AxographIO (filename = filename )
256248 blk = reader .read_block (signal_group_mode = 'group-by-same-units' )
257249
@@ -274,7 +266,7 @@ def test_group_by_same_units(self):
274266 def test_events_and_epochs (self ):
275267 """Test loading events and epochs"""
276268
277- filename = self .get_filename_path ( ' events_and_epochs.axgx' )
269+ filename = self .get_local_path ( 'axograph/ events_and_epochs.axgx' )
278270 reader = AxographIO (filename = filename )
279271 blk = reader .read_block (signal_group_mode = 'split-all' )
280272
@@ -297,14 +289,14 @@ def test_rec_datetime(self):
297289
298290 # file obtained in episodic acquisition mode has date and time on
299291 # separate lines of notes
300- filename = self .get_filename_path ( ' episodic.axgd' )
292+ filename = self .get_local_path ( 'axograph/ episodic.axgd' )
301293 reader = AxographIO (filename = filename )
302294 blk = reader .read_block (signal_group_mode = 'split-all' )
303295 assert_equal (blk .rec_datetime , datetime (2018 , 6 , 7 , 15 , 11 , 36 ))
304296
305297 # file obtained in continuous acquisition mode has date and time in
306298 # single line of notes
307- filename = self .get_filename_path ( ' events_and_epochs.axgx' )
299+ filename = self .get_local_path ( 'axograph/ events_and_epochs.axgx' )
308300 reader = AxographIO (filename = filename )
309301 blk = reader .read_block (signal_group_mode = 'split-all' )
310302 assert_equal (blk .rec_datetime , datetime (2019 , 5 , 25 , 20 , 16 , 25 ))
0 commit comments