forked from openlp/openlp
Fix some pep8 issues
This commit is contained in:
parent
879a51a1fe
commit
2bd58e1c29
@ -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')
|
||||
|
@ -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
|
||||
|
@ -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 '
|
||||
|
Loading…
Reference in New Issue
Block a user