def test_over_octave_chord_build(): c = Chord.build_chord(Note.from_note_string('G4'), 'II', 'minor') expected = [ Note.from_note_string('A4'), Note.from_note_string('C5'), Note.from_note_string('E5b') ] assert c.notes == expected
def test_simple_major_chord_build_non_tonic(): c = Chord.build_chord(Note.from_note_string('C4'), 'V', 'major') expected = [ Note.from_note_string('G4'), Note.from_note_string('B4'), Note.from_note_string('D5') ] assert c.notes == expected
def test_simple_minor_chord_build(): c = Chord.build_chord(Note.from_note_string('C4'), 'I', 'minor') expected = [ Note.from_note_string('C4'), Note.from_note_string('E4b'), Note.from_note_string('G4') ] assert c.notes == expected
def test_chord_unsupported_chord_type(): with pytest.raises(ValueError): Chord.build_chord(Note.from_note_string('C4'), 'V', 'doobly`')
def test_chord_unsupported_chord_num(): with pytest.raises(ValueError): Chord.build_chord(Note.from_note_string('C4'), 'VIIII', 'maj')
def test_chord_float_tonic(): with pytest.raises(TypeError): Chord.build_chord(7.2, 'IV', 'maj')
def test_chord_int_tonic(): with pytest.raises(TypeError): Chord.build_chord(4, 'IV', 'maj')
def test_chord_str_tonic(): with pytest.raises(TypeError): Chord.build_chord('Hi', 'IV', 'maj')