Fix tests for NotifyGnome (#703)

This commit is contained in:
Andreas Motl 2022-10-16 22:53:36 +02:00 committed by GitHub
parent 8983288236
commit f01e6d8a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -211,7 +211,7 @@ class NotifyGnome(NotifyBase):
except Exception as e: except Exception as e:
self.logger.warning( self.logger.warning(
"Could not load notification icon (%s). ", icon_path) "Could not load notification icon (%s).", icon_path)
self.logger.debug(f'Gnome Exception: {e}') self.logger.debug(f'Gnome Exception: {e}')
notification.show() notification.show()

View File

@ -305,8 +305,8 @@ def test_plugin_gnome_missing_icon(mocker, obj):
assert obj.notify(title='title', body='body', assert obj.notify(title='title', body='body',
notify_type=apprise.NotifyType.INFO) is True notify_type=apprise.NotifyType.INFO) is True
assert logger.mock_calls == [ assert logger.mock_calls == [
call.warning('Could not load notification icon (%s). ' call.warning('Could not load notification icon (%s).', ANY),
'Reason: Something failed', ANY), call.debug('Gnome Exception: Something failed'),
call.info('Sent Gnome notification.'), call.info('Sent Gnome notification.'),
] ]
@ -365,7 +365,6 @@ def test_plugin_gnome_notify_croaks(mocker, obj):
title='title', body='body', title='title', body='body',
notify_type=apprise.NotifyType.INFO) is False notify_type=apprise.NotifyType.INFO) is False
assert logger.mock_calls == [ assert logger.mock_calls == [
call.warning('Failed to send Gnome notification. ' call.warning('Failed to send Gnome notification.'),
'Reason: Something failed'), call.debug('Gnome Exception: Something failed'),
call.exception('Gnome Exception')
] ]