forked from openlp/openlp
Fix linting
This commit is contained in:
parent
40ceb07f18
commit
490f9bbe15
@ -264,7 +264,7 @@ class SongSelectForm(QtWidgets.QDialog, Ui_SongSelectDialog, RegistryProperties)
|
||||
self.application.process_events()
|
||||
# Log the user in
|
||||
subscription_level = self.song_select_importer.login(
|
||||
self.username_edit.text(), self.password_edit.text(), self._update_login_progress)
|
||||
self.username_edit.text(), self.password_edit.text(), self._update_login_progress)
|
||||
if not subscription_level:
|
||||
QtWidgets.QMessageBox.critical(
|
||||
self,
|
||||
@ -275,10 +275,11 @@ class SongSelectForm(QtWidgets.QDialog, Ui_SongSelectDialog, RegistryProperties)
|
||||
else:
|
||||
if subscription_level == 'Free':
|
||||
QtWidgets.QMessageBox.information(
|
||||
self,
|
||||
translate('SongsPlugin.SongSelectForm', 'Free user'),
|
||||
translate('SongsPlugin.SongSelectForm',
|
||||
'You logged in with a free account, the search will be limited to songs in the public domain.')
|
||||
self,
|
||||
translate('SongsPlugin.SongSelectForm', 'Free user'),
|
||||
translate('SongsPlugin.SongSelectForm', 'You logged in with a free account, '
|
||||
'the search will be limited to songs '
|
||||
'in the public domain.')
|
||||
)
|
||||
if self.save_password_checkbox.isChecked():
|
||||
Settings().setValue(self.plugin.settings_section + '/songselect username', self.username_edit.text())
|
||||
|
@ -130,7 +130,7 @@ class SongSelectImport(object):
|
||||
else:
|
||||
log.debug(posted_page)
|
||||
return None
|
||||
|
||||
|
||||
def find_subscription_level(self, page):
|
||||
scripts = page.find_all('script')
|
||||
for tag in scripts:
|
||||
@ -139,7 +139,7 @@ class SongSelectImport(object):
|
||||
if match:
|
||||
return match.group('subscription_level')
|
||||
log.error('Could not determine SongSelect subscription level')
|
||||
return 'unkown'
|
||||
return None
|
||||
|
||||
def logout(self):
|
||||
"""
|
||||
|
@ -129,7 +129,7 @@ class TestSongSelectImport(TestCase, TestMixin):
|
||||
assert 2 == mocked_login_page.find.call_count, 'find should have been called twice on the login page'
|
||||
assert 1 == mocked_posted_page.find.call_count, 'find should have been called once on the posted page'
|
||||
assert 2 == mocked_opener.open.call_count, 'opener should have been called twice'
|
||||
assert result is 'unkown', 'The login method should have returned the subscription level'
|
||||
assert result is None, 'The login method should have returned the subscription level'
|
||||
|
||||
@patch('openlp.plugins.songs.lib.songselect.build_opener')
|
||||
@patch('openlp.plugins.songs.lib.songselect.BeautifulSoup')
|
||||
@ -159,7 +159,7 @@ class TestSongSelectImport(TestCase, TestMixin):
|
||||
assert 2 == mocked_login_page.find.call_count, 'find should have been called twice on the login page'
|
||||
assert 1 == mocked_posted_page.find.call_count, 'find should have been called once on the posted page'
|
||||
assert 'https://profile.ccli.com/do/login', mocked_opener.open.call_args_list[1][0][0]
|
||||
assert result is 'unkown', 'The login method should have returned the subscription level'
|
||||
assert result is None, 'The login method should have returned the subscription level'
|
||||
|
||||
@patch('openlp.plugins.songs.lib.songselect.build_opener')
|
||||
def test_logout(self, mocked_build_opener):
|
||||
|
Loading…
Reference in New Issue
Block a user