Browse Source

Merge pull request #126 from patacrep/encoding_issue

Bug in tests when accentuated chars are used
pull/127/merge
Louis 9 years ago
parent
commit
bb0274fef9
  1. 4
      test/test_chordpro/metadata.sgc
  2. 4
      test/test_chordpro/metadata.source
  3. 4
      test/test_chordpro/metadata.tex
  4. 3
      test/test_chordpro/test_parser.py

4
test/test_chordpro/metadata.sgc

@ -1,13 +1,13 @@
{lang: fr} {lang: fr}
{capo: Capo} {capo: Capo}
{title: Title} {title: Je t'ai Manqué}
{title: Subtitle1} {title: Subtitle1}
{title: Subtitle2} {title: Subtitle2}
{title: Subtitle3} {title: Subtitle3}
{title: Subtitle4} {title: Subtitle4}
{title: Subtitle5} {title: Subtitle5}
{artist: Author1} {artist: Author1}
{artist: Author2} {artist: Texte de Jean Richepin, chanté par Georges Brassens}
{album: Album} {album: Album}
{copyright: Copyright} {copyright: Copyright}
{cov: metadata_cover} {cov: metadata_cover}

4
test/test_chordpro/metadata.source

@ -1,5 +1,5 @@
{subtitle: Subtitle3} {subtitle: Subtitle3}
{title: Title} {title: Je t'ai Manqué}
{title: Subtitle1} {title: Subtitle1}
{subtitle: Subtitle4} {subtitle: Subtitle4}
{t: Subtitle2} {t: Subtitle2}
@ -7,7 +7,7 @@
{lang: en} {lang: en}
{lang: fr} {lang: fr}
{by: Author1} {by: Author1}
{artist: Author2} {artist: Texte de Jean Richepin, chanté par Georges Brassens}
{album: Album} {album: Album}
{copyright: Copyright} {copyright: Copyright}
{cover: metadata_cover} {cover: metadata_cover}

4
test/test_chordpro/metadata.tex

@ -1,6 +1,6 @@
\selectlanguage{french} \selectlanguage{french}
\beginsong{Title\\ \beginsong{Je t'ai Manqué\\
Subtitle1\\ Subtitle1\\
Subtitle2\\ Subtitle2\\
Subtitle3\\ Subtitle3\\
@ -8,7 +8,7 @@ Subtitle4\\
Subtitle5}[ Subtitle5}[
by={ by={
Author1, Author1,
Author2 }, Texte de Jean Richepin, chanté par Georges Brassens },
album={Album}, album={Album},
copyright={Copyright}, copyright={Copyright},
cov={img/test/test_chordpro/metadata_cover}, cov={img/test/test_chordpro/metadata_cover},

3
test/test_chordpro/test_parser.py

@ -9,6 +9,7 @@ from pkg_resources import resource_filename
from patacrep import files from patacrep import files
from patacrep.build import DEFAULT_CONFIG from patacrep.build import DEFAULT_CONFIG
from patacrep.encoding import open_read
from .. import disable_logging from .. import disable_logging
@ -63,7 +64,7 @@ class FileTestMeta(type):
if base is None or dest is None: if base is None or dest is None:
return return
destname = "{}.{}".format(base, dest) destname = "{}.{}".format(base, dest)
with open(destname, 'r', encoding='utf8') as expectfile: with open_read(destname) as expectfile:
chordproname = "{}.source".format(base) chordproname = "{}.source".format(base)
with disable_logging(): with disable_logging():
self.assertMultiLineEqual( self.assertMultiLineEqual(

Loading…
Cancel
Save