From f8c54520a18a4a5127cd297e6f4f161e7a352f43 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 5 Oct 2018 01:12:09 +0200 Subject: [PATCH] python/tests/test_notes.py: test notes.set/get_release_drop --- python/tests/test_notes.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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') -- 2.11.0