mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
improve coverage
This commit is contained in:
parent
0b6cceb998
commit
58f0838d3d
@ -20,20 +20,39 @@ class NotificationTests(BaseNotificationIntegrationTest):
|
|||||||
"""a comment so we do not need a pass"""
|
"""a comment so we do not need a pass"""
|
||||||
|
|
||||||
class NoNameNotificationMethod(NotificationMethod):
|
class NoNameNotificationMethod(NotificationMethod):
|
||||||
pass
|
|
||||||
|
def send(self):
|
||||||
|
"""a comment so we do not need a pass"""
|
||||||
|
|
||||||
|
class WrongContextNotificationMethod(NotificationMethod):
|
||||||
|
METHOD_NAME = 'WrongContextNotification'
|
||||||
|
CONTEXT_EXTRA = [
|
||||||
|
'aa',
|
||||||
|
('aa', 'bb', ),
|
||||||
|
('templates', 'ccc', ),
|
||||||
|
(123, )
|
||||||
|
]
|
||||||
|
|
||||||
|
def send(self):
|
||||||
|
"""a comment so we do not need a pass"""
|
||||||
|
|
||||||
# no send / send bulk
|
# no send / send bulk
|
||||||
with self.assertRaises(NotImplementedError):
|
with self.assertRaises(NotImplementedError):
|
||||||
FalseNotificationMethod('', '', '', '', )
|
FalseNotificationMethod('', '', '', '', )
|
||||||
|
|
||||||
# no gathering
|
|
||||||
with self.assertRaises(NotImplementedError):
|
|
||||||
AnotherFalseNotificationMethod('', '', '', '', )
|
|
||||||
|
|
||||||
# no METHOD_NAME
|
# no METHOD_NAME
|
||||||
with self.assertRaises(NotImplementedError):
|
with self.assertRaises(NotImplementedError):
|
||||||
NoNameNotificationMethod('', '', '', '', )
|
NoNameNotificationMethod('', '', '', '', )
|
||||||
|
|
||||||
|
# a not existant context check
|
||||||
|
with self.assertRaises(NotImplementedError):
|
||||||
|
WrongContextNotificationMethod('', '', '', '', )
|
||||||
|
|
||||||
|
# no get_targets
|
||||||
|
with self.assertRaises(NotImplementedError):
|
||||||
|
AnotherFalseNotificationMethod('', '', '', {'name': 1, 'message': 2, } )
|
||||||
|
|
||||||
|
|
||||||
def test_SingleNotificationMethod(self):
|
def test_SingleNotificationMethod(self):
|
||||||
"""ensure the implementation requirements are tested"""
|
"""ensure the implementation requirements are tested"""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user