Changeset 39be048


Ignore:
Timestamp:
Feb 27, 2017, 1:59:39 AM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, sampler
Children:
140b460
Parents:
25d58dc
Message:

python/tests/test_source.py: test with interface (PEP 343)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_source.py

    r25d58dc r39be048  
    170170        return total_frames
    171171
     172class aubio_source_with(aubio_source_test_case_base):
     173
     174    #@params(*list_of_sounds)
     175    @params(*list_of_sounds)
     176    def test_read_from_mono(self, filename):
     177        total_frames = 0
     178        hop_size = 2048
     179        with source(filename, 0, hop_size) as input_source:
     180            assert_equal(input_source.hop_size, hop_size)
     181            #assert_equal(input_source.samplerate, samplerate)
     182            total_frames = 0
     183            for frames in input_source:
     184                total_frames += frames.shape[-1]
     185            # check we read as many samples as we expected
     186            assert_equal(total_frames, input_source.duration)
     187
    172188if __name__ == '__main__':
    173189    main()
Note: See TracChangeset for help on using the changeset viewer.