From 2dd770ea119d77e3b9d3edea1c91a33cd519d180 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Fri, 9 Sep 2016 22:47:29 +0100 Subject: [PATCH] PEP fixes --- .../openlp_plugins/bibles/test_bibleimport.py | 18 +++++++++--------- .../openlp_plugins/bibles/test_osisimport.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/functional/openlp_plugins/bibles/test_bibleimport.py b/tests/functional/openlp_plugins/bibles/test_bibleimport.py index 6de470d87..a2244dbf7 100644 --- a/tests/functional/openlp_plugins/bibles/test_bibleimport.py +++ b/tests/functional/openlp_plugins/bibles/test_bibleimport.py @@ -232,14 +232,14 @@ class TestBibleImport(TestCase): # called with patch.object(BibleImport, 'log_debug'), \ patch('openlp.plugins.bibles.lib.bibleimport.BiblesResourcesDB', - **{'get_book.return_value':{'id': 20}}): + **{'get_book.return_value': {'id': 20}}): instance = BibleImport(MagicMock()) # WHEN: Calling get_book_ref_id_by_name result = instance.get_book_ref_id_by_name('Gen', 66, 4) # THEN: The bible id should be returned - self.assertEqual(result,20) + self.assertEqual(result, 20) def get_book_ref_id_by_name_get_alternative_book_name_test(self): """ @@ -266,7 +266,7 @@ class TestBibleImport(TestCase): # get_book_reference_id is called with patch.object(BibleImport, 'log_debug'), \ patch('openlp.plugins.bibles.lib.bibleimport.BiblesResourcesDB', - **{'get_book.return_value': None, 'get_alternative_book_name.return_value': None}), \ + **{'get_book.return_value': None, 'get_alternative_book_name.return_value': None}), \ patch('openlp.plugins.bibles.lib.bibleimport.AlternativeBookNamesDB', **{'get_book_reference_id.return_value': 40}): instance = BibleImport(MagicMock()) @@ -303,12 +303,12 @@ class TestBibleImport(TestCase): """ # GIVEN: An instance of BibleImport and a mocked BookNameForm which simulates a user accepting the dialog with patch.object(BibleImport, 'log_debug'), patch.object(BibleImport, 'get_books'), \ - patch('openlp.plugins.bibles.lib.bibleimport.BiblesResourcesDB', - **{'get_book.return_value': None, 'get_alternative_book_name.return_value': None}), \ - patch('openlp.plugins.bibles.lib.bibleimport.AlternativeBookNamesDB', - **{'get_book_reference_id.return_value': None}) as mocked_alternative_book_names_db, \ - patch('openlp.plugins.bibles.forms.BookNameForm', - return_value=MagicMock(**{'exec.return_value': QDialog.Accepted, 'book_id':50})): + patch('openlp.plugins.bibles.lib.bibleimport.BiblesResourcesDB', + **{'get_book.return_value': None, 'get_alternative_book_name.return_value': None}), \ + patch('openlp.plugins.bibles.lib.bibleimport.AlternativeBookNamesDB', + **{'get_book_reference_id.return_value': None}) as mocked_alternative_book_names_db, \ + patch('openlp.plugins.bibles.forms.BookNameForm', + return_value=MagicMock(**{'exec.return_value': QDialog.Accepted, 'book_id': 50})): instance = BibleImport(MagicMock()) # WHEN: Calling get_book_ref_id_by_name diff --git a/tests/functional/openlp_plugins/bibles/test_osisimport.py b/tests/functional/openlp_plugins/bibles/test_osisimport.py index eaaea7206..18f591faf 100644 --- a/tests/functional/openlp_plugins/bibles/test_osisimport.py +++ b/tests/functional/openlp_plugins/bibles/test_osisimport.py @@ -32,7 +32,7 @@ from openlp.plugins.bibles.lib.bibleimport import BibleImport from openlp.plugins.bibles.lib.db import BibleDB from openlp.plugins.bibles.lib.importers.osis import OSISBible -TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources', 'bibles')) +TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources', 'bibles')) class TestOsisImport(TestCase):