Changeset f0ce8aa3


Ignore:
Timestamp:
Oct 29, 2018, 3:26:24 PM (14 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
a88594d
Parents:
60c8a73
Message:

[py] [slicing] add test for missing end of last region

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_slicing.py

    r60c8a73 rf0ce8aa3  
    9898            "number of samples written different from number of original samples")
    9999
     100    def test_slice_start_and_ends_with_missing_end(self):
     101        regions_start = [i*1000 for i in range(n_slices)]
     102        regions_ends = [r-1 for r in regions_start[1:]]
     103        slice_source_at_stamps(self.source_file, regions_start, regions_ends,
     104                output_dir = self.output_dir)
     105        written_samples = count_samples_in_directory(self.output_dir)
     106        original_samples = count_samples_in_file(self.source_file)
     107        total_files = count_files_in_directory(self.output_dir)
     108        assert_equal(n_slices, total_files,
     109            "number of slices created different from expected")
     110        assert_equal(written_samples, original_samples,
     111            "number of samples written different from number of original samples")
     112
    100113    def tearDown(self):
    101114        shutil.rmtree(self.output_dir)
Note: See TracChangeset for help on using the changeset viewer.