def test_parse_barline_song_item(self):
     region = as_region("|")
     parsed_item = SongItem.parse(region)
     region = as_region("|")
     parsed_barline = BarLine.parse(region)
     self.assertEquals(parsed_item, parsed_barline)
 def test_bar_line_parse_wrong(self):
     with self.parse_exception('Invalid bar line: "wrong"', "wrong"):
         region = as_region("wrong")
         BarLine.parse(region)
 def test_bar_source_and_unparse(self):
     region = as_region("|")
     bar_line = BarLine.parse(region)
     self.assertEquals(bar_line.source.value, bar_line.unparse())
 def test_bar_line_parse(self):
     region = as_region("|")
     bar_line = BarLine.parse(region)
     self.assertEquals(bar_line.source, region)
     self.assertEquals(bar_line, BarLine())
 def test_bar_line_parse(self):
     with self.parse_exception('Invalid bar line: "|extra" (extra data "extra")', "extra"):
         region = as_region("|extra")
         BarLine.parse(region)
 def test_parse_barline_song_item(self):
     region = as_region('|')
     parsed_item = SongItem.parse(region)
     region = as_region('|')
     parsed_barline = BarLine.parse(region)
     self.assertEquals(parsed_item, parsed_barline)
 def test_bar_source_and_unparse(self):
     region = as_region('|')
     bar_line = BarLine.parse(region)
     self.assertEquals(bar_line.source.value, bar_line.unparse())
 def test_bar_line_parse_wrong(self):
     with self.parse_exception('Invalid bar line: "wrong"', 'wrong'):
         region = as_region('wrong')
         BarLine.parse(region)
 def test_bar_line_parse(self):
     with self.parse_exception(
             'Invalid bar line: "|extra" (extra data "extra")', 'extra'):
         region = as_region('|extra')
         BarLine.parse(region)
 def test_bar_line_parse(self):
     region = as_region('|')
     bar_line = BarLine.parse(region)
     self.assertEquals(bar_line.source, region)
     self.assertEquals(bar_line, BarLine())