Mercurial > hg > auditok
changeset 229:19b8f4f28d7b
Update tests for AudioRegion slicing using temporal views
author | Amine Sehili <amine.sehili@gmail.com> |
---|---|
date | Sat, 13 Jul 2019 11:19:25 +0100 |
parents | a51015e6f90d |
children | 1a3cf18658c6 |
files | tests/test_core.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test_core.py Sat Jul 13 11:00:41 2019 +0100 +++ b/tests/test_core.py Sat Jul 13 11:19:25 2019 +0100 @@ -878,14 +878,22 @@ def test_region_slicing( self, region, slice_, expected_start, expected_data ): - sub_region = region[slice_] + sub_region = region.millis[slice_] self.assertEqual(sub_region.start, expected_start) self.assertEqual(bytes(sub_region), expected_data) + start_sec = slice_.start / 1000 if slice_.start is not None else None + stop_sec = slice_.stop / 1000 if slice_.stop is not None else None + + sub_region = region.sec[start_sec:stop_sec] + self.assertEqual(sub_region.start, expected_start) + self.assertEqual(bytes(sub_region), expected_data) + + @genty_dataset( simple=(8000, 1, 1), stereo_sw_2=(8000, 2, 2), - arbitray_sr_multichannel=(5413, 2, 3), + arbitrary_sr_multichannel=(5413, 2, 3), ) def test_concatenation(self, sampling_rate, sample_width, channels): @@ -909,7 +917,7 @@ @genty_dataset( simple=(8000, 1, 1), stereo_sw_2=(8000, 2, 2), - arbitray_sr_multichannel=(5413, 2, 3), + arbitrary_sr_multichannel=(5413, 2, 3), ) def test_concatenation_many(self, sampling_rate, sample_width, channels):