python/tests/test_notes.py: test notes.set/get_release_drop
authorPaul Brossier <piem@piem.org>
Thu, 4 Oct 2018 23:12:09 +0000 (01:12 +0200)
committerPaul Brossier <piem@piem.org>
Thu, 4 Oct 2018 23:12:09 +0000 (01:12 +0200)
python/tests/test_notes.py

index 44aa3e7..5b65046 100755 (executable)
@@ -5,6 +5,7 @@ from numpy.testing import TestCase, assert_equal, assert_almost_equal
 from aubio import notes
 
 AUBIO_DEFAULT_NOTES_SILENCE = -70.
+AUBIO_DEFAULT_NOTES_RELEASE_DROP = 10.
 AUBIO_DEFAULT_NOTES_MINIOI_MS = 30.
 
 class aubio_notes_default(TestCase):
@@ -38,6 +39,19 @@ class aubio_notes_params(TestCase):
         self.o.set_silence(val)
         assert_equal (self.o.get_silence(), val)
 
+    def test_get_release_drop(self):
+        assert_equal (self.o.get_release_drop(), AUBIO_DEFAULT_NOTES_RELEASE_DROP)
+
+    def test_set_release_drop(self):
+        val = 50
+        self.o.set_release_drop(val)
+        assert_equal (self.o.get_release_drop(), val)
+
+    def test_set_release_drop_wrong(self):
+        val = -10
+        with self.assertRaises(ValueError):
+            self.o.set_release_drop(val)
+
 from .utils import list_all_sounds
 list_of_sounds = list_all_sounds('sounds')