Changeset 4949182 for python


Ignore:
Timestamp:
Jan 31, 2014, 10:14:26 PM (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:
c76345e
Parents:
2e17371
Message:

python/tests/test_{source,sink}.py: add close() tests

Location:
python/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_sink.py

    r2e17371 r4949182  
    4242                #del f, g
    4343
     44    def test_close_file(self):
     45        samplerate = 44100
     46        g = sink('/tmp/f.wav', samplerate)
     47        g.close()
     48
     49    def test_close_file_twice(self):
     50        samplerate = 44100
     51        g = sink('/tmp/f.wav', samplerate)
     52        g.close()
     53        g.close()
     54
    4455if __name__ == '__main__':
    4556    from unittest import main
  • python/tests/test_source.py

    r2e17371 r4949182  
    6969            self.read_from_sink(f)
    7070
     71    def test_close_file(self):
     72        samplerate = 0 # use native samplerate
     73        hop_size = 256
     74        for p in list_of_sounds:
     75            f = source(p, samplerate, hop_size)
     76            f.close()
     77
     78    def test_close_file_twice(self):
     79        samplerate = 0 # use native samplerate
     80        hop_size = 256
     81        for p in list_of_sounds:
     82            f = source(p, samplerate, hop_size)
     83            f.close()
     84            f.close()
     85
    7186if __name__ == '__main__':
    7287    from unittest import main
Note: See TracChangeset for help on using the changeset viewer.