File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,20 @@ def test_read_with_index_file(test_file, expected_data):
482
482
compare_arrays (channel_obj .data , expected_channel_data )
483
483
484
484
485
+ def test_read_index_file_only ():
486
+ """ Test reading the index file directly
487
+ """
488
+ test_file , expected_data = scenarios .single_segment_with_two_channels ().values
489
+ with test_file .get_tempfile_with_index () as tdms_file_path :
490
+ with TdmsFile .open (tdms_file_path + "_index" ) as tdms_file :
491
+ for ((group , channel ), expected_channel_data ) in expected_data .items ():
492
+ channel_obj = tdms_file [group ][channel ]
493
+ assert len (channel_obj ) == len (expected_channel_data )
494
+ with pytest .raises (RuntimeError ) as exc_info :
495
+ channel_obj [:]
496
+ assert "Data cannot be read from index file only" in str (exc_info .value )
497
+
498
+
485
499
@pytest .mark .skipif (sys .version_info < (3 , 4 ), reason = "pathlib only available in stdlib since 3.4" )
486
500
def test_read_file_passed_as_pathlib_path ():
487
501
""" Test reading a file when using a pathlib Path object
You can’t perform that action at this time.
0 commit comments