From 074ae6da22fab41e971f39020cdb7da4d930046f Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 09:10:31 +0200 Subject: [PATCH 1/2] Test bug when accentuated chars are used --- test/test_chordpro/metadata.sgc | 4 ++-- test/test_chordpro/metadata.source | 4 ++-- test/test_chordpro/metadata.tex | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_chordpro/metadata.sgc b/test/test_chordpro/metadata.sgc index 559f3dd3..945b4185 100644 --- a/test/test_chordpro/metadata.sgc +++ b/test/test_chordpro/metadata.sgc @@ -1,13 +1,13 @@ {lang: fr} {capo: Capo} -{title: Title} +{title: Je t'ai Manqué} {title: Subtitle1} {title: Subtitle2} {title: Subtitle3} {title: Subtitle4} {title: Subtitle5} {artist: Author1} -{artist: Author2} +{artist: Texte de Jean Richepin, chanté par Georges Brassens} {album: Album} {copyright: Copyright} {cov: metadata_cover} diff --git a/test/test_chordpro/metadata.source b/test/test_chordpro/metadata.source index 7a623009..b9c41cc6 100644 --- a/test/test_chordpro/metadata.source +++ b/test/test_chordpro/metadata.source @@ -1,5 +1,5 @@ {subtitle: Subtitle3} -{title: Title} +{title: Je t'ai Manqué} {title: Subtitle1} {subtitle: Subtitle4} {t: Subtitle2} @@ -7,7 +7,7 @@ {lang: en} {lang: fr} {by: Author1} -{artist: Author2} +{artist: Texte de Jean Richepin, chanté par Georges Brassens} {album: Album} {copyright: Copyright} {cover: metadata_cover} diff --git a/test/test_chordpro/metadata.tex b/test/test_chordpro/metadata.tex index a3a36676..280efd19 100644 --- a/test/test_chordpro/metadata.tex +++ b/test/test_chordpro/metadata.tex @@ -1,6 +1,6 @@ \selectlanguage{french} -\beginsong{Title\\ +\beginsong{Je t'ai Manqué\\ Subtitle1\\ Subtitle2\\ Subtitle3\\ @@ -8,7 +8,7 @@ Subtitle4\\ Subtitle5}[ by={ Author1, - Author2 }, + Texte de Jean Richepin, chanté par Georges Brassens }, album={Album}, copyright={Copyright}, cov={img/test/test_chordpro/metadata_cover}, From 523a513b86e1c9eb5a4b313b2a82d6dd47d653c5 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 09:18:14 +0200 Subject: [PATCH 2/2] Use the same open_read function for the tests --- test/test_chordpro/metadata.sgc | 2 +- test/test_chordpro/metadata.tex | 2 +- test/test_chordpro/test_parser.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_chordpro/metadata.sgc b/test/test_chordpro/metadata.sgc index 945b4185..22c59f59 100644 --- a/test/test_chordpro/metadata.sgc +++ b/test/test_chordpro/metadata.sgc @@ -7,7 +7,7 @@ {title: Subtitle4} {title: Subtitle5} {artist: Author1} -{artist: Texte de Jean Richepin, chanté par Georges Brassens} +{artist: Texte de Jean Richepin, chanté par Georges Brassens} {album: Album} {copyright: Copyright} {cov: metadata_cover} diff --git a/test/test_chordpro/metadata.tex b/test/test_chordpro/metadata.tex index 280efd19..d2a2273a 100644 --- a/test/test_chordpro/metadata.tex +++ b/test/test_chordpro/metadata.tex @@ -8,7 +8,7 @@ Subtitle4\\ Subtitle5}[ by={ Author1, - Texte de Jean Richepin, chanté par Georges Brassens }, + Texte de Jean Richepin, chanté par Georges Brassens }, album={Album}, copyright={Copyright}, cov={img/test/test_chordpro/metadata_cover}, diff --git a/test/test_chordpro/test_parser.py b/test/test_chordpro/test_parser.py index 6ce2a83a..ba4abdcd 100644 --- a/test/test_chordpro/test_parser.py +++ b/test/test_chordpro/test_parser.py @@ -9,6 +9,7 @@ from pkg_resources import resource_filename from patacrep import files from patacrep.build import DEFAULT_CONFIG +from patacrep.encoding import open_read from .. import disable_logging @@ -63,7 +64,7 @@ class FileTestMeta(type): if base is None or dest is None: return destname = "{}.{}".format(base, dest) - with open(destname, 'r', encoding='utf8') as expectfile: + with open_read(destname) as expectfile: chordproname = "{}.source".format(base) with disable_logging(): self.assertMultiLineEqual(