forked from openlp/openlp
PEP fixes
This commit is contained in:
parent
14187f4884
commit
6fc1467c5a
@ -79,7 +79,8 @@ class ZefaniaBible(BibleImport):
|
||||
chapter_number = CHAPTER.get("cnumber")
|
||||
for VERS in CHAPTER:
|
||||
verse_number = VERS.get("vnumber")
|
||||
self.create_verse(db_book.id, int(chapter_number), int(verse_number), VERS.text.replace('<BR/>', '\n'))
|
||||
self.create_verse(
|
||||
db_book.id, int(chapter_number), int(verse_number), VERS.text.replace('<BR/>', '\n'))
|
||||
self.wizard.increment_progress_bar(
|
||||
translate('BiblesPlugin.Zefnia',
|
||||
'Importing {book} {chapter}...').format(book=db_book.name,
|
||||
|
@ -173,8 +173,8 @@ class TestBibleImport(TestCase):
|
||||
# THEN: None should be returned and an error should be logged
|
||||
mocked_languages_get_language.assert_called_once_with('Qwerty')
|
||||
mocked_db_get_language.assert_called_once_with('KJV')
|
||||
self.mocked_log.error.assert_called_once_with('Language detection failed when importing from "KJV". '
|
||||
'User aborted language selection.')
|
||||
self.mocked_log.error.assert_called_once_with(
|
||||
'Language detection failed when importing from "KJV". User aborted language selection.')
|
||||
self.assertFalse(instance.save_meta.called)
|
||||
self.assertIsNone(result)
|
||||
|
||||
@ -418,8 +418,7 @@ class TestBibleImport(TestCase):
|
||||
Test that validate_xml_file raises a ValidationError with an Zefania root tag
|
||||
"""
|
||||
# GIVEN: Some test data with an Zefania root tag and an instance of BibleImport
|
||||
with patch.object(BibleImport, 'parse_xml',
|
||||
return_value=objectify.fromstring('<xmlbible></xmlbible>')), \
|
||||
with patch.object(BibleImport, 'parse_xml', return_value=objectify.fromstring('<xmlbible></xmlbible>')), \
|
||||
patch.object(BibleImport, 'is_compressed', return_value=False):
|
||||
importer = BibleImport(MagicMock(), path='.', name='.', filename='')
|
||||
|
||||
@ -437,8 +436,8 @@ class TestBibleImport(TestCase):
|
||||
Test that validate_xml_file raises a ValidationError with an unknown root tag
|
||||
"""
|
||||
# GIVEN: Some test data with an unknown root tag and an instance of BibleImport
|
||||
with patch.object(BibleImport, 'parse_xml',
|
||||
return_value=objectify.fromstring('<unknownbible></unknownbible>')), \
|
||||
with patch.object(
|
||||
BibleImport, 'parse_xml', return_value=objectify.fromstring('<unknownbible></unknownbible>')), \
|
||||
patch.object(BibleImport, 'is_compressed', return_value=False):
|
||||
importer = BibleImport(MagicMock(), path='.', name='.', filename='')
|
||||
|
||||
|
@ -217,7 +217,8 @@ class TestOpenSongImport(TestCase, TestMixin):
|
||||
importer.process_books([book1, book2])
|
||||
|
||||
# THEN: find_and_create_book and process_books should be called with the details from the mocked books
|
||||
self.assertEqual(self.mocked_find_and_create_book.call_args_list, [call('Name1', 2, 10), call('Name2', 2, 10)])
|
||||
self.assertEqual(self.mocked_find_and_create_book.call_args_list,
|
||||
[call('Name1', 2, 10), call('Name2', 2, 10)])
|
||||
self.assertEqual(mocked_process_chapters.call_args_list,
|
||||
[call('db_book1', 'Chapter1'), call('db_book2', 'Chapter2')])
|
||||
self.assertEqual(importer.session.commit.call_count, 2)
|
||||
@ -374,6 +375,7 @@ class TestOpenSongImport(TestCase, TestMixin):
|
||||
# THEN: do_import should return True
|
||||
self.assertTrue(result)
|
||||
|
||||
|
||||
class TestOpenSongImportFileImports(TestCase, TestMixin):
|
||||
"""
|
||||
Test the functions in the :mod:`opensongimport` module.
|
||||
|
Loading…
Reference in New Issue
Block a user