Changeset 6f27719 for python/tests


Ignore:
Timestamp:
Jan 12, 2014, 4:28:49 AM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
a4ec189
Parents:
aee840b
Message:

python/lib/aubio/slicing.py: improve slicing, make tests faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_slicing.py

    raee840b r6f27719  
    1111import shutil
    1212
     13n_slices = 8
     14
    1315class aubio_slicing_test_case(TestCase):
    1416
     
    1820
    1921    def test_slice_start_only(self):
    20         regions_start = [i*1000 for i in range(100)]
     22        regions_start = [i*1000 for i in range(n_slices)]
    2123        slice_source_at_stamps(self.source_file, regions_start, output_dir = self.output_dir)
    2224
    2325    def test_slice_start_only_no_zero(self):
    24         regions_start = [i*1000 for i in range(1, 100)]
     26        regions_start = [i*1000 for i in range(1, n_slices)]
    2527        slice_source_at_stamps(self.source_file, regions_start, output_dir = self.output_dir)
    2628
    2729    def test_slice_start_beyond_end(self):
    28         regions_start = [i*1000 for i in range(1, 100)]
     30        regions_start = [i*1000 for i in range(1, n_slices)]
    2931        regions_start += [count_samples_in_file(self.source_file)]
    3032        regions_start += [count_samples_in_file(self.source_file) + 1000]
     
    3436        original_samples = count_samples_in_file(self.source_file)
    3537        written_samples = count_samples_in_directory(self.output_dir)
    36         assert_equal(original_samples, written_samples,
    37             "number samples written different from number of original samples")
     38        assert_equal(written_samples, original_samples,
     39            "number of samples written different from number of original samples")
    3840        shutil.rmtree(self.output_dir)
    3941
     
    7981        original_samples = count_samples_in_file(self.source_file)
    8082        written_samples = count_samples_in_directory(self.output_dir)
    81         assert_equal(original_samples, written_samples,
    82             "number samples written different from number of original samples")
     83        assert_equal(written_samples, original_samples,
     84            "number of samples written different from number of original samples")
    8385
    8486    def tearDown(self):
Note: See TracChangeset for help on using the changeset viewer.