From 3b7d5f53babe6856d1b51e7e566071ed8a026269 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 3 Jul 2014 19:57:13 +0200 Subject: [PATCH] PEP8 --- openlp/plugins/songs/lib/songimport/__init__.py | 2 +- .../openlp_plugins/songs/test_opensongimport.py | 2 +- .../songs/test_worshipcenterproimport.py | 12 ++++++------ tests/helpers/songfileimport.py | 12 ++++++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport/__init__.py b/openlp/plugins/songs/lib/songimport/__init__.py index f57136ecf..da302572e 100644 --- a/openlp/plugins/songs/lib/songimport/__init__.py +++ b/openlp/plugins/songs/lib/songimport/__init__.py @@ -27,5 +27,5 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ -The :mod:`~openlp.plugins.songs.lib.import` module contains a importers for the Songs plugin. +The :mod:`~openlp.plugins.songs.lib.import` module contains importers for the Songs plugin. """ diff --git a/tests/functional/openlp_plugins/songs/test_opensongimport.py b/tests/functional/openlp_plugins/songs/test_opensongimport.py index 8e7fee0af..09fad7bc3 100644 --- a/tests/functional/openlp_plugins/songs/test_opensongimport.py +++ b/tests/functional/openlp_plugins/songs/test_opensongimport.py @@ -1,4 +1,4 @@ - # -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### diff --git a/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py b/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py index 263397cc9..27c688aa0 100644 --- a/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py +++ b/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py @@ -156,9 +156,9 @@ class TestWorshipCenterProSongImport(TestCase): """ # GIVEN: A mocked out SongImport class, a mocked out pyodbc module, a mocked out translate method, # a mocked "manager" and a mocked out log_error method. - with patch('openlp.plugins.songs.lib.worshipcenterproimport.SongImport'), \ - patch('openlp.plugins.songs.lib.worshipcenterproimport.pyodbc.connect') as mocked_pyodbc_connect, \ - patch('openlp.plugins.songs.lib.worshipcenterproimport.translate') as mocked_translate: + with patch('openlp.plugins.songs.lib.songimport.worshipcenterproimport.SongImport'), \ + patch('openlp.plugins.songs.lib.songimport.worshipcenterproimport.pyodbc.connect') as mocked_pyodbc_connect, \ + patch('openlp.plugins.songs.lib.songimport.worshipcenterproimport.translate') as mocked_translate: mocked_manager = MagicMock() mocked_log_error = MagicMock() mocked_translate.return_value = 'Translated Text' @@ -185,9 +185,9 @@ class TestWorshipCenterProSongImport(TestCase): """ # GIVEN: A mocked out SongImport class, a mocked out pyodbc module with a simulated recordset, a mocked out # translate method, a mocked "manager", add_verse method & mocked_finish method. - with patch('openlp.plugins.songs.lib.worshipcenterproimport.SongImport'), \ - patch('openlp.plugins.songs.lib.worshipcenterproimport.pyodbc') as mocked_pyodbc, \ - patch('openlp.plugins.songs.lib.worshipcenterproimport.translate') as mocked_translate: + with patch('openlp.plugins.songs.lib.songimport.worshipcenterproimport.SongImport'), \ + patch('openlp.plugins.songs.lib.songimport.worshipcenterproimport.pyodbc') as mocked_pyodbc, \ + patch('openlp.plugins.songs.lib.songimport.worshipcenterproimport.translate') as mocked_translate: mocked_manager = MagicMock() mocked_import_wizard = MagicMock() mocked_add_verse = MagicMock() diff --git a/tests/helpers/songfileimport.py b/tests/helpers/songfileimport.py index 0b0e3515d..003ade543 100644 --- a/tests/helpers/songfileimport.py +++ b/tests/helpers/songfileimport.py @@ -51,14 +51,18 @@ class SongImportTestHelper(TestCase): Patch and set up the mocks required. """ self.add_copyright_patcher = patch( - 'openlp.plugins.songs.lib.songimport.%s.%s.add_copyright' % (self.importer_module_name, self.importer_class_name)) + 'openlp.plugins.songs.lib.songimport.%s.%s.add_copyright' % (self.importer_module_name, + self.importer_class_name)) self.add_verse_patcher = patch( - 'openlp.plugins.songs.lib.songimport.%s.%s.add_verse' % (self.importer_module_name, self.importer_class_name)) + 'openlp.plugins.songs.lib.songimport.%s.%s.add_verse' % (self.importer_module_name, + self.importer_class_name)) self.finish_patcher = patch( 'openlp.plugins.songs.lib.songimport.%s.%s.finish' % (self.importer_module_name, self.importer_class_name)) self.add_author_patcher = patch( - 'openlp.plugins.songs.lib.songimport.%s.%s.add_author' % (self.importer_module_name, self.importer_class_name)) - self.song_import_patcher = patch('openlp.plugins.songs.lib.songimport.%s.SongImport' % self.importer_module_name) + 'openlp.plugins.songs.lib.songimport.%s.%s.add_author' % (self.importer_module_name, + self.importer_class_name)) + self.song_import_patcher = patch('openlp.plugins.songs.lib.songimport.%s.SongImport' % + self.importer_module_name) self.mocked_add_copyright = self.add_copyright_patcher.start() self.mocked_add_verse = self.add_verse_patcher.start() self.mocked_finish = self.finish_patcher.start()