shithub: aubio

Download patch

ref: e9a440263005222ed072a03114f238f4d3510d6a
parent: 6f944b5bddfdea3f17e76128fc9f376fe2ce0998
author: Paul Brossier <piem@piem.org>
date: Mon Oct 29 20:54:33 EDT 2018

[py] test note2freq

--- a/python/tests/test_note2midi.py
+++ b/python/tests/test_note2midi.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 
-from aubio import note2midi, freq2note
+from aubio import note2midi, freq2note, note2freq
 from nose2.tools import params
 import unittest
 
@@ -118,6 +118,16 @@
     def test_freq2note_under(self):
         " make sure freq2note(439) == A4 "
         self.assertEqual("A4", freq2note(439))
+
+class note2freq_simple_test(unittest.TestCase):
+
+    def test_note2freq(self):
+        " make sure note2freq('A3') == 220"
+        self.assertEqual(220, note2freq("A3"))
+
+    def test_note2freq_under(self):
+        " make sure note2freq(A4) == 440"
+        self.assertEqual(440, note2freq("A4"))
 
 if __name__ == '__main__':
     import nose2