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()
|
self.application.process_events()
|
||||||
# Log the user in
|
# Log the user in
|
||||||
subscription_level = self.song_select_importer.login(
|
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:
|
if not subscription_level:
|
||||||
QtWidgets.QMessageBox.critical(
|
QtWidgets.QMessageBox.critical(
|
||||||
self,
|
self,
|
||||||
@ -277,8 +277,9 @@ class SongSelectForm(QtWidgets.QDialog, Ui_SongSelectDialog, RegistryProperties)
|
|||||||
QtWidgets.QMessageBox.information(
|
QtWidgets.QMessageBox.information(
|
||||||
self,
|
self,
|
||||||
translate('SongsPlugin.SongSelectForm', 'Free user'),
|
translate('SongsPlugin.SongSelectForm', 'Free user'),
|
||||||
translate('SongsPlugin.SongSelectForm',
|
translate('SongsPlugin.SongSelectForm', 'You logged in with a free account, '
|
||||||
'You logged in with a free account, the search will be limited to songs in the public domain.')
|
'the search will be limited to songs '
|
||||||
|
'in the public domain.')
|
||||||
)
|
)
|
||||||
if self.save_password_checkbox.isChecked():
|
if self.save_password_checkbox.isChecked():
|
||||||
Settings().setValue(self.plugin.settings_section + '/songselect username', self.username_edit.text())
|
Settings().setValue(self.plugin.settings_section + '/songselect username', self.username_edit.text())
|
||||||
|
@ -139,7 +139,7 @@ class SongSelectImport(object):
|
|||||||
if match:
|
if match:
|
||||||
return match.group('subscription_level')
|
return match.group('subscription_level')
|
||||||
log.error('Could not determine SongSelect subscription level')
|
log.error('Could not determine SongSelect subscription level')
|
||||||
return 'unkown'
|
return None
|
||||||
|
|
||||||
def logout(self):
|
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 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 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 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.build_opener')
|
||||||
@patch('openlp.plugins.songs.lib.songselect.BeautifulSoup')
|
@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 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 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 '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')
|
@patch('openlp.plugins.songs.lib.songselect.build_opener')
|
||||||
def test_logout(self, mocked_build_opener):
|
def test_logout(self, mocked_build_opener):
|
||||||
|
Loading…
Reference in New Issue
Block a user