From f7c944acc96e689b6b1ea65884cc59da08a724a8 Mon Sep 17 00:00:00 2001 From: Simon Hanna Date: Mon, 13 Mar 2017 13:42:20 +0100 Subject: [PATCH] Add test --- .../openlp_plugins/songs/test_songbeamerimport.py | 4 ++++ tests/resources/songbeamersongs/cp1252song.json | 8 ++++++++ tests/resources/songbeamersongs/cp1252song.sng | 15 +++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 tests/resources/songbeamersongs/cp1252song.json create mode 100644 tests/resources/songbeamersongs/cp1252song.sng diff --git a/tests/functional/openlp_plugins/songs/test_songbeamerimport.py b/tests/functional/openlp_plugins/songs/test_songbeamerimport.py index 48de3a755..ccbd3a4d8 100644 --- a/tests/functional/openlp_plugins/songs/test_songbeamerimport.py +++ b/tests/functional/openlp_plugins/songs/test_songbeamerimport.py @@ -49,6 +49,10 @@ class TestSongBeamerFileImport(SongImportTestHelper): self.file_import([os.path.join(TEST_PATH, 'Lobsinget dem Herrn.sng')], self.load_external_result_data(os.path.join(TEST_PATH, 'Lobsinget dem Herrn.json'))) + def test_cp1252_encoded_file(self): + self.file_import([os.path.join(TEST_PATH, 'cp1252song.sng')], + self.load_external_result_data(os.path.join(TEST_PATH, 'cp1252song.json'))) + class TestSongBeamerImport(TestCase): """ diff --git a/tests/resources/songbeamersongs/cp1252song.json b/tests/resources/songbeamersongs/cp1252song.json new file mode 100644 index 000000000..5e92d7038 --- /dev/null +++ b/tests/resources/songbeamersongs/cp1252song.json @@ -0,0 +1,8 @@ +{ +"title": "Some Song", + "authors": ["Author"], + "verses" : [ + ["Here are a couple of \"weird\" chars’’’.\n", "v"], + ["Here is another one….\n\n", "v"] + ] +} diff --git a/tests/resources/songbeamersongs/cp1252song.sng b/tests/resources/songbeamersongs/cp1252song.sng new file mode 100644 index 000000000..f1288e731 --- /dev/null +++ b/tests/resources/songbeamersongs/cp1252song.sng @@ -0,0 +1,15 @@ +#LangCount=1 +#Editor=SongBeamer 4.28a +#Version=3 +#Format=F/K// +#TitleFormat=U +#Title=Some Song +#Author=Author +#Melody=Author +#(c)=No copyright +#CCLI=0000000000 +--- +Here are a couple of "weird" chars’’’. +--- +Here is another one…. +