Ignore:
Timestamp:
Mar 12, 2017, 11:26:24 AM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler
Children:
bde49c4a
Parents:
71f2e5f (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge 'origin/master' into sampler

Conflicts:

.travis.yml
Makefile
examples/aubionotes.c
examples/parse_args.h
python/demos/demo_timestretch_online.py
python/lib/moresetuptools.py
python/tests/test_source.py
setup.py
src/io/source.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_sink.py

    r71f2e5f r41b985f  
    55from numpy.testing import TestCase
    66from aubio import fvec, source, sink
    7 from utils import list_all_sounds, get_tmp_sink_path, del_tmp_sink_path
     7from .utils import list_all_sounds, get_tmp_sink_path, del_tmp_sink_path
     8
     9import warnings
     10warnings.filterwarnings('ignore', category=UserWarning, append=True)
    811
    912list_of_sounds = list_all_sounds('sounds')
     
    2629        if not len(list_of_sounds):
    2730            self.skipTest('add some sound files in \'python/tests/sounds\'')
     31
     32    def test_wrong_filename(self):
     33        with self.assertRaises(RuntimeError):
     34            sink('')
     35
     36    def test_wrong_samplerate(self):
     37        with self.assertRaises(RuntimeError):
     38            sink(get_tmp_sink_path(), -1)
     39
     40    def test_wrong_samplerate_too_large(self):
     41        with self.assertRaises(RuntimeError):
     42            sink(get_tmp_sink_path(), 1536001, 2)
     43
     44    def test_wrong_channels(self):
     45        with self.assertRaises(RuntimeError):
     46            sink(get_tmp_sink_path(), 44100, -1)
     47
     48    def test_wrong_channels_too_large(self):
     49        with self.assertRaises(RuntimeError):
     50            sink(get_tmp_sink_path(), 44100, 202020)
    2851
    2952    def test_many_sinks(self):
     
    94117        del_tmp_sink_path(sink_path)
    95118
     119    def test_read_with(self):
     120        sink_path =get_tmp_sink_path()
     121        vec = fvec(128)
     122        with sink(sink_path, samplerate) as g:
     123            for i in range(10):
     124                g(vec, 128)
     125
    96126if __name__ == '__main__':
    97127    main()
Note: See TracChangeset for help on using the changeset viewer.