fix tests + method name test

This commit is contained in:
Matthias 2021-12-04 01:10:46 +01:00
parent e18f7d49cc
commit 4e07b4bf72
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -11,23 +11,33 @@ class NotificationTests(BaseNotificationIntegrationTest):
"""ensure the implementation requirements are tested""" """ensure the implementation requirements are tested"""
class FalseNotificationMethod(NotificationMethod): class FalseNotificationMethod(NotificationMethod):
pass METHOD_NAME = 'FalseNotification'
class AnotherFalseNotificationMethod(NotificationMethod): class AnotherFalseNotificationMethod(NotificationMethod):
METHOD_NAME = 'AnotherFalseNotification'
def send(self): def send(self):
pass pass
class NoNameNotificationMethod(NotificationMethod):
pass
with self.assertRaises(NotImplementedError): with self.assertRaises(NotImplementedError):
FalseNotificationMethod('', '', '') FalseNotificationMethod('', '', '')
with self.assertRaises(NotImplementedError): with self.assertRaises(NotImplementedError):
AnotherFalseNotificationMethod('', '', '') AnotherFalseNotificationMethod('', '', '')
with self.assertRaises(NotImplementedError):
NoNameNotificationMethod('', '', '')
def test_SingleNotificationMethod(self): def test_SingleNotificationMethod(self):
"""ensure the implementation requirements are tested""" """ensure the implementation requirements are tested"""
print('TESTING SingleNotificationMethod') print('TESTING SingleNotificationMethod')
class WrongImplementation(SingleNotificationMethod): class WrongImplementation(SingleNotificationMethod):
METHOD_NAME = 'WrongImplementation1'
def setup(self): def setup(self):
print('running setup on WrongImplementation') print('running setup on WrongImplementation')
return super().setup() return super().setup()
@ -40,6 +50,8 @@ class NotificationTests(BaseNotificationIntegrationTest):
print('TESTING BulkNotificationMethod') print('TESTING BulkNotificationMethod')
class WrongImplementation(BulkNotificationMethod): class WrongImplementation(BulkNotificationMethod):
METHOD_NAME = 'WrongImplementation2'
def setup(self): def setup(self):
print('running setup on WrongImplementation') print('running setup on WrongImplementation')
return super().setup() return super().setup()