shithub: aubio

Download patch

ref: f8c54520a18a4a5127cd297e6f4f161e7a352f43
parent: 6bba139da789a532b9712f199dd84e6f3a70aafd
author: Paul Brossier <piem@piem.org>
date: Thu Oct 4 21:12:09 EDT 2018

python/tests/test_notes.py: test notes.set/get_release_drop

--- a/python/tests/test_notes.py
+++ b/python/tests/test_notes.py
@@ -5,6 +5,7 @@
 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):
@@ -37,6 +38,19 @@
         val = -50
         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')