From 4afeac2e223f4f13d2d754cee9dc41fc02103f85 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 29 Oct 2018 23:54:56 +0100 Subject: [PATCH] [py] [test] make sure freq2note rounds to nearest integer midi note --- python/tests/test_note2midi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/tests/test_note2midi.py b/python/tests/test_note2midi.py index 261b025b..d145ff17 100755 --- a/python/tests/test_note2midi.py +++ b/python/tests/test_note2midi.py @@ -111,10 +111,14 @@ class note2midi_wrong_values(unittest.TestCase): class freq2note_simple_test(unittest.TestCase): - def test_freq2note(self): + def test_freq2note_above(self): " make sure freq2note(441) == A4 " self.assertEqual("A4", freq2note(441)) + def test_freq2note_under(self): + " make sure freq2note(439) == A4 " + self.assertEqual("A4", freq2note(439)) + if __name__ == '__main__': import nose2 nose2.main() -- 2.11.0