shithub: aubio

Download patch

ref: 693de50ac5ab978671b9a84ca8f1cb83a5bba77c
parent: e33d960a588b6a449a39f60c9b2a72134e2db441
author: Paul Brossier <piem@piem.org>
date: Fri Nov 9 14:13:31 EST 2018

[tests] also test for duplicate values in set_triangle_bands

--- a/python/tests/test_filterbank_mel.py
+++ b/python/tests/test_filterbank_mel.py
@@ -94,6 +94,22 @@
         # 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()