From 2bd58e1c294621588bf34c6c25297d603780ec42 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 13 Aug 2016 16:41:24 +0200 Subject: [PATCH] Fix some pep8 issues --- openlp/plugins/songs/lib/songselect.py | 6 ++++-- .../functional/openlp_core_ui_media/test_systemplayer.py | 1 + tests/functional/openlp_plugins/songs/test_songselect.py | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/songselect.py b/openlp/plugins/songs/lib/songselect.py index 84d6d7b90..ccec2c2d8 100644 --- a/openlp/plugins/songs/lib/songselect.py +++ b/openlp/plugins/songs/lib/songselect.py @@ -37,7 +37,8 @@ from openlp.plugins.songs.lib import Song, Author, Topic, VerseType, clean_song from openlp.plugins.songs.lib.openlyricsxml import SongXML USER_AGENTS = [ - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36' + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) ' \ + 'Chrome/52.0.2743.116 Safari/537.36', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36', 'Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0', @@ -195,7 +196,8 @@ class SongSelectImport(object): theme_elements.extend(ul.find_all('li')[1:]) song['copyright'] = '/'.join([unescape(li.string).strip() for li in copyright_elements]) song['topics'] = [unescape(li.string).strip() for li in theme_elements] - song['ccli_number'] = song_page.find('div', 'song-content-data').find('ul').find('li').find('strong').string.strip() + song['ccli_number'] = song_page.find('div', 'song-content-data').find('ul').find('li')\ + .find('strong').string.strip() song['verses'] = [] verses = lyrics_page.find('div', 'song-viewer lyrics').find_all('p') verse_labels = lyrics_page.find('div', 'song-viewer lyrics').find_all('h3') diff --git a/tests/functional/openlp_core_ui_media/test_systemplayer.py b/tests/functional/openlp_core_ui_media/test_systemplayer.py index 357e91e44..d1873d2df 100644 --- a/tests/functional/openlp_core_ui_media/test_systemplayer.py +++ b/tests/functional/openlp_core_ui_media/test_systemplayer.py @@ -32,6 +32,7 @@ from openlp.core.ui.media.systemplayer import SystemPlayer, CheckMediaWorker, AD from tests.functional import MagicMock, call, patch + class TestSystemPlayer(TestCase): """ Test the system media player diff --git a/tests/functional/openlp_plugins/songs/test_songselect.py b/tests/functional/openlp_plugins/songs/test_songselect.py index 362163f58..70c0d40fc 100644 --- a/tests/functional/openlp_plugins/songs/test_songselect.py +++ b/tests/functional/openlp_plugins/songs/test_songselect.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +# pylint: disable=protected-access ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -650,7 +651,7 @@ class TestSongSelectForm(TestCase, TestMixin): # WHEN: _update_login_progress() is called with patch.object(ssform, 'login_progress_bar') as mocked_login_progress_bar: mocked_login_progress_bar.value.return_value = 3 - ssform._update_login_progress() # pylint: disable=protected-access + ssform._update_login_progress() # THEN: The login progress bar should be updated mocked_login_progress_bar.setValue.assert_called_with(4) @@ -665,7 +666,7 @@ class TestSongSelectForm(TestCase, TestMixin): # WHEN: _update_song_progress() is called with patch.object(ssform, 'song_progress_bar') as mocked_song_progress_bar: mocked_song_progress_bar.value.return_value = 2 - ssform._update_song_progress() # pylint: disable=protected-access + ssform._update_song_progress() # THEN: The song progress bar should be updated mocked_song_progress_bar.setValue.assert_called_with(3) @@ -822,7 +823,7 @@ class TestSearchWorker(TestCase, TestMixin): worker.start() # THEN: The "finished" and "quit" signals should be emitted - importer.search.assert_called_with(search_text, 1000, worker._found_song_callback) # pylint: disable=protected-access + importer.search.assert_called_with(search_text, 1000, worker._found_song_callback) mocked_finished.emit.assert_called_with() mocked_quit.emit.assert_called_with() @@ -844,7 +845,7 @@ class TestSearchWorker(TestCase, TestMixin): worker.start() # THEN: The "finished" and "quit" signals should be emitted - importer.search.assert_called_with(search_text, 1000, worker._found_song_callback) # pylint: disable=protected-access + importer.search.assert_called_with(search_text, 1000, worker._found_song_callback) mocked_show_info.emit.assert_called_with('More than 1000 results', 'Your search has returned more than 1000 ' 'results, it has been stopped. Please ' 'refine your search to fetch better '