Exemplo n.º 1
0
def test_tone_from_midi(A4):
    assert Tone.from_midi(69) == A4
    with pytest.raises(ValueError):
        Tone.from_midi(500)
    with pytest.raises(ValueError):
        Tone.from_midi(-1)
Exemplo n.º 2
0
def test_tone_note(A4):
    assert A4.note == "A4"
    assert A4.up().note == "A#4"
    assert A4.down().note == "G#4"
    with pytest.raises(ValueError):
        Tone.from_midi(8).note