def parse_chord_line_test(): parsed = parser.parse_line('A7 Cm Fm7') eq_(parsed.type, 'chord') chords = parsed.data.chords eq_(len(chords), 3) eq_(chords[0].chord, Chord.parse('A7')) eq_(chords[0].position, 0) eq_(chords[1].chord, Chord.parse('Cm')) eq_(chords[1].position, 6) eq_(chords[2].chord, Chord.parse('Fm7')) eq_(chords[2].position, 12)
def parse_empty_line_test(): parsed = parser.parse_line('') eq_(parsed.type, 'empty')
def parse_lyric_line_test(): lyrics = 'This is a lyrics line' parsed = parser.parse_line(lyrics) eq_(parsed.type, 'lyric') eq_(parsed.data.lyrics, lyrics)