def test_read_block_with_time_slices(self):
        r = ExampleIO(filename=None)
        bl = r.read_block(time_slices=None)
        real_segments = bl.segments
        assert len(real_segments) == 2

        time_slices = [(1, 3), (4, 5), (16, 21), (21.5, 22.)]
        bl = r.read_block(time_slices=time_slices)
        sliced_segments = bl.segments
        assert len(sliced_segments) == len(time_slices)

        with self.assertRaises(ValueError):
            buggy_time_slices = [(11, 14)]
            bl = r.read_block(time_slices=buggy_time_slices)
 def test_read_block_with_time_slices(self):
     r = ExampleIO(filename=None)
     bl = r.read_block(time_slices=None)
     real_segments = bl.segments
     assert len(real_segments)==2
     
     
     time_slices = [(1, 3), (4, 5), (16, 21), (21.5, 22.)]
     bl = r.read_block(time_slices=time_slices)
     sliced_segments = bl.segments
     assert len(sliced_segments)==len(time_slices)
     
     with self.assertRaises(ValueError):
         buggy_time_slices = [(11, 14)]
         bl = r.read_block(time_slices=buggy_time_slices)
Beispiel #3
0
 def test_read_block(self):
     r = ExampleIO(filename=None)
     bl = r.read_block(lazy=True)
Beispiel #4
0
 def test_read_block(self):
     r = ExampleIO(filename=None)
     bl = r.read_block(lazy=True)
     assert len(bl.list_units) == 3
     assert len(bl.channel_indexes) == 1 + 3  # signals grouped + units
Beispiel #5
0
 def test_read_block(self):
     r = ExampleIO(filename=None)
     bl = r.read_block(lazy=True)
     assert len(bl.list_units) == 3
     assert len(bl.channel_indexes) == 1 + 3  # signals grouped + units