Added unit tests for midi.py