From: Paul Brossier Date: Fri, 9 Nov 2018 18:13:31 +0000 (+0100) Subject: [tests] also test for duplicate values in set_triangle_bands X-Git-Tag: 0.4.8~62 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=693de50ac5ab978671b9a84ca8f1cb83a5bba77c;p=aubio.git [tests] also test for duplicate values in set_triangle_bands --- diff --git a/python/tests/test_filterbank_mel.py b/python/tests/test_filterbank_mel.py index c77b44c4..fc8c1598 100755 --- a/python/tests/test_filterbank_mel.py +++ b/python/tests/test_filterbank_mel.py @@ -94,6 +94,22 @@ class aubio_filterbank_mel_test_case(TestCase): # TODO add assert_warns f.set_triangle_bands(fvec(freq_list), samplerate) + def test_triangle_freqs_with_double_value(self): + """make sure set_triangle_bands works with 2 duplicate freqs""" + samplerate = 22050 + freq_list = [0, 100, 1000, 4000, 4000, 4000, 10000] + f = filterbank(len(freq_list)-2, 1024) + # TODO add assert_warns + f.set_triangle_bands(fvec(freq_list), samplerate) + + def test_triangle_freqs_with_triple(self): + """make sure set_triangle_bands works with 3 duplicate freqs""" + samplerate = 22050 + freq_list = [0, 100, 1000, 4000, 4000, 4000, 10000] + f = filterbank(len(freq_list)-2, 1024) + # TODO add assert_warns + f.set_triangle_bands(fvec(freq_list), samplerate) + if __name__ == '__main__': import nose2 nose2.main()