Test fixes

This commit is contained in:
Phill Ridout 2017-12-22 22:35:09 +00:00
parent 38c124224f
commit a866bc5499
2 changed files with 16 additions and 13 deletions

View File

@ -60,21 +60,24 @@ class SundayPlusImport(SongImport):
for file_path in self.import_source:
if self.stop_import_flag:
return
with file_path.open('rb') as song_file:
self.do_import_file(song_file)
self.do_import_file(file_path)
def do_import_file(self, file_path):
"""
Process the Sunday Plus file object.
Process the Sunday Plus song file
:param openlp.core.common.path.Path file_path: The song file to import
:rtype: None
"""
self.set_defaults()
if not self.parse(file_path.read()):
self.log_error(file_path.name)
return
if self.title == '':
self.title = self.title_from_file_path(file_path)
if not self.finish():
self.log_error(file_path.name)
with file_path.open('rb') as song_file:
self.set_defaults()
if not self.parse(song_file.read()):
self.log_error(file_path.name)
return
if self.title == '':
self.title = self.title_from_file_path(file_path)
if not self.finish():
self.log_error(file_path.name)
def parse(self, data, cell=False):
"""

View File

@ -34,9 +34,9 @@ except ImportError:
from openlp.plugins.bibles.lib.db import BibleDB
from tests.utils import load_external_result_data
from tests.utils.constants import TEST_RESOURCES_PATH
from tests.utils.constants import RESOURCE_PATH
TEST_PATH = TEST_RESOURCES_PATH / 'bibles'
TEST_PATH = RESOURCE_PATH / 'bibles'
@skipUnless(HAS_PYSWORD, 'pysword not installed')