more coverage

This commit is contained in:
Matthias 2021-12-04 18:50:49 +01:00
parent d156e4c431
commit 5567ee432a
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -36,6 +36,15 @@ class BaseNotificationTests(BaseNotificationIntegrationTest):
def send(self): def send(self):
"""a comment so we do not need a pass""" """a comment so we do not need a pass"""
class WrongDeliveryImplementation(SingleNotificationMethod):
METHOD_NAME = 'WrongDeliveryImplementation'
def get_targets(self):
return [1, ]
def send(self, target):
return False
# no send / send bulk # no send / send bulk
with self.assertRaises(NotImplementedError): with self.assertRaises(NotImplementedError):
FalseNotificationMethod('', '', '', '', ) FalseNotificationMethod('', '', '', '', )
@ -52,6 +61,9 @@ class BaseNotificationTests(BaseNotificationIntegrationTest):
with self.assertRaises(NotImplementedError): with self.assertRaises(NotImplementedError):
AnotherFalseNotificationMethod('', '', '', {'name': 1, 'message': 2, }, ) AnotherFalseNotificationMethod('', '', '', {'name': 1, 'message': 2, }, )
# cover faling delivery
self._notification_run()
def test_errors_passing(self): def test_errors_passing(self):
"""ensure that errors do not kill the whole delivery""" """ensure that errors do not kill the whole delivery"""