tests/test_{midi2note,note2midi}.py: add header and encoding
authorPaul Brossier <piem@piem.org>
Sun, 10 Mar 2013 16:37:28 +0000 (11:37 -0500)
committerPaul Brossier <piem@piem.org>
Sun, 10 Mar 2013 16:37:28 +0000 (11:37 -0500)
python/lib/aubio/midiconv.py
python/tests/test_midi2note.py [changed mode: 0644->0755]
python/tests/test_note2midi.py

index e658290..445afd8 100644 (file)
@@ -1,10 +1,10 @@
-# -*- encoding: utf8 -*-
+# -*- coding: utf-8 -*-
 
 def note2midi(note):
     " convert note name to midi note number, e.g. [C-1, G9] -> [0, 127] "
     _valid_notenames = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}
     _valid_modifiers = {None: 0, u'♮': 0, '#': +1, u'♯': +1, u'\udd2a': +2, 'b': -1, u'♭': -1, u'\ufffd': -2}
-    _valid_octaves = range(-1, 10) 
+    _valid_octaves = range(-1, 10)
     if type(note) not in (str, unicode):
         raise TypeError, "a string is required, got %s" % note
     if not (1 < len(note) < 5):
old mode 100644 (file)
new mode 100755 (executable)
index cf865d6..ce854bf
@@ -1,4 +1,5 @@
-# -*- encoding: utf8 -*-
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
 
 from aubio import midi2note
 import unittest
@@ -13,14 +14,14 @@ list_of_known_midis = (
         ( 127, 'G9' ),
         )
 
-class TestMidi2NoteGoodValues(unittest.TestCase):
+class midi2note_good_values(unittest.TestCase):
 
     def test_midi2note_known_values(self):
         " known values are correctly converted "
         for midi, note in list_of_known_midis:
             self.assertEqual ( midi2note(midi), note )
 
-class TestNote2MidiWrongValues(unittest.TestCase):
+class midi2note_wrong_values(unittest.TestCase):
 
     def test_midi2note_negative_value(self):
         " fails when passed a negative value "
index b22b6a3..77be894 100755 (executable)
@@ -1,4 +1,5 @@
-# -*- encoding: utf8 -*-
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
 
 from aubio import note2midi
 import unittest
@@ -22,14 +23,14 @@ list_of_known_notes = (
         ( u'A♮2', 45 ),
         )
 
-class TestNote2MidiGoodValues(unittest.TestCase):
+class note2midi_good_values(unittest.TestCase):
 
     def test_note2midi_known_values(self):
         " known values are correctly converted "
         for note, midi in list_of_known_notes:
             self.assertEqual ( note2midi(note), midi )
 
-class TestNote2MidiWrongValues(unittest.TestCase):
+class note2midi_wrong_values(unittest.TestCase):
 
     def test_note2midi_missing_octave(self):
         " fails when passed only one character"