From: Paul Brossier Date: Thu, 4 Oct 2018 23:12:09 +0000 (+0200) Subject: python/tests/test_notes.py: test notes.set/get_release_drop X-Git-Tag: 0.4.8~97 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=f8c54520a18a4a5127cd297e6f4f161e7a352f43;p=aubio.git python/tests/test_notes.py: test notes.set/get_release_drop --- diff --git a/python/tests/test_notes.py b/python/tests/test_notes.py index 44aa3e7a..5b65046f 100755 --- a/python/tests/test_notes.py +++ b/python/tests/test_notes.py @@ -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')